opusdec: Truncate caps first
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Wed, 7 Dec 2011 05:06:11 +0000 (00:06 -0500)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 7 Dec 2011 14:03:00 +0000 (14:03 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=665078

ext/opus/gstopusdec.c

index af0f0f3..6c57648 100644 (file)
@@ -217,7 +217,12 @@ static GstCaps *
 gst_opus_dec_negotiate (GstOpusDec * dec)
 {
   GstCaps *caps = gst_pad_get_allowed_caps (GST_AUDIO_DECODER_SRC_PAD (dec));
-  GstStructure *s = gst_caps_get_structure (caps, 0);
+  GstStructure *s;
+
+  caps = gst_caps_make_writable (caps);
+  gst_caps_truncate (caps);
+
+  s = gst_caps_get_structure (caps, 0);
   gst_structure_fixate_field_nearest_int (s, "rate", 48000);
   gst_structure_get_int (s, "rate", &dec->sample_rate);
   gst_structure_fixate_field_nearest_int (s, "channels", dec->n_channels);