mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
audiodecoder: fix criticals fixating a non existent field
https://bugzilla.gnome.org/show_bug.cgi?id=766970
This commit is contained in:
parent
66342c5c86
commit
c76e8c77eb
1 changed files with 13 additions and 5 deletions
|
@ -2012,10 +2012,18 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * dec)
|
||||||
|
|
||||||
for (i = 0; i < caps_size; i++) {
|
for (i = 0; i < caps_size; i++) {
|
||||||
structure = gst_caps_get_structure (caps, i);
|
structure = gst_caps_get_structure (caps, i);
|
||||||
|
if (gst_structure_has_field (structure, "channels"))
|
||||||
gst_structure_fixate_field_nearest_int (structure,
|
gst_structure_fixate_field_nearest_int (structure,
|
||||||
"channels", GST_AUDIO_DEF_CHANNELS);
|
"channels", GST_AUDIO_DEF_CHANNELS);
|
||||||
|
else
|
||||||
|
gst_structure_set (structure, "channels", G_TYPE_INT,
|
||||||
|
GST_AUDIO_DEF_CHANNELS, NULL);
|
||||||
|
if (gst_structure_has_field (structure, "rate"))
|
||||||
gst_structure_fixate_field_nearest_int (structure,
|
gst_structure_fixate_field_nearest_int (structure,
|
||||||
"rate", GST_AUDIO_DEF_RATE);
|
"rate", GST_AUDIO_DEF_RATE);
|
||||||
|
else
|
||||||
|
gst_structure_set (structure, "rate", G_TYPE_INT, GST_AUDIO_DEF_RATE,
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
caps = gst_caps_fixate (caps);
|
caps = gst_caps_fixate (caps);
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
Loading…
Reference in a new issue