From b7d53c866b0dc379db62a99c19cd5cca1ca51719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 7 Dec 2011 00:06:11 -0500 Subject: [PATCH] opusdec: Truncate caps first https://bugzilla.gnome.org/show_bug.cgi?id=665078 --- ext/opus/gstopusdec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c index af0f0f3771..6c57648b8a 100644 --- a/ext/opus/gstopusdec.c +++ b/ext/opus/gstopusdec.c @@ -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);