From 8dde6b170bfa2058fadbd73df714541129fb19aa Mon Sep 17 00:00:00 2001 From: Jose Antonio Santos Cadenas Date: Mon, 4 May 2015 10:35:55 +0200 Subject: [PATCH] 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 --- ext/opus/gstopusheader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/opus/gstopusheader.c b/ext/opus/gstopusheader.c index 6155ac0696..1521c1c071 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) {