summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Santos Cadenas <santoscadenas@gmail.com>2015-05-04 10:35:55 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-05-04 10:50:42 +0200
commit8dde6b170bfa2058fadbd73df714541129fb19aa (patch)
treed53eec11383fe398451175a39a9620fb3b1466c8
parent97c3e548d66b8a1bd1f0fc7c7047a69f0896c4b5 (diff)
downloadgstreamer-plugins-base-8dde6b170bfa2058fadbd73df714541129fb19aa.tar.gz
opusheader: Do not include rate in caps if it is 0
As expressed in gst_opus_header_create_caps, value 0 means unset. Setting rate value to 0 make negotiation with decoder fail. https://bugzilla.gnome.org/show_bug.cgi?id=748875
-rw-r--r--ext/opus/gstopusheader.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/opus/gstopusheader.c b/ext/opus/gstopusheader.c
index 6155ac069..1521c1c07 100644
--- a/ext/opus/gstopusheader.c
+++ b/ext/opus/gstopusheader.c
@@ -196,7 +196,12 @@ gst_opus_header_create_caps_from_headers (GstCaps ** caps, GSList ** headers,
multistream = n_streams > 1;
*caps = gst_caps_new_simple ("audio/x-opus",
"multistream", G_TYPE_BOOLEAN, multistream,
- "channels", G_TYPE_INT, channels, "rate", G_TYPE_INT, rate, NULL);
+ "channels", G_TYPE_INT, channels, NULL);
+
+ if (rate > 0) {
+ gst_caps_set_simple (*caps, "rate", G_TYPE_INT, rate, NULL);
+ }
+
*caps = _gst_caps_set_buffer_array (*caps, "streamheader", buf1, buf2, NULL);
if (headers) {