mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
opusdec: Truncate caps first
https://bugzilla.gnome.org/show_bug.cgi?id=665078
This commit is contained in:
parent
f6ebc2de8e
commit
b7d53c866b
1 changed files with 6 additions and 1 deletions
|
@ -217,7 +217,12 @@ static GstCaps *
|
||||||
gst_opus_dec_negotiate (GstOpusDec * dec)
|
gst_opus_dec_negotiate (GstOpusDec * dec)
|
||||||
{
|
{
|
||||||
GstCaps *caps = gst_pad_get_allowed_caps (GST_AUDIO_DECODER_SRC_PAD (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_fixate_field_nearest_int (s, "rate", 48000);
|
||||||
gst_structure_get_int (s, "rate", &dec->sample_rate);
|
gst_structure_get_int (s, "rate", &dec->sample_rate);
|
||||||
gst_structure_fixate_field_nearest_int (s, "channels", dec->n_channels);
|
gst_structure_fixate_field_nearest_int (s, "channels", dec->n_channels);
|
||||||
|
|
Loading…
Reference in a new issue