audiodecoder: fix ctitical info assertion 'GST_IS_CAPS (dec->priv->ctx.caps)' failed

Matroskademux will send gap event when lag of video and audio is over 3 seconds.
audiodecoder needs to handle gap event and set default output caps.
Only audio info is set, while output caps is ignored. This cause the assertion failed.

Need to fill output caps in gst_audio_decoder_negotiate_default_caps() with
negotiated caps to avoid critical info printed when check it later.
This commit is contained in:
Hou Qi 2019-08-21 19:04:56 +08:00 committed by Qi Hou
parent 564ab3031b
commit b65d1c6de9

View file

@ -2195,11 +2195,11 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * dec)
GST_OBJECT_LOCK (dec); GST_OBJECT_LOCK (dec);
dec->priv->ctx.info = info; dec->priv->ctx.info = info;
dec->priv->ctx.caps = caps;
GST_OBJECT_UNLOCK (dec); GST_OBJECT_UNLOCK (dec);
GST_INFO_OBJECT (dec, GST_INFO_OBJECT (dec,
"Chose default caps %" GST_PTR_FORMAT " for initial gap", caps); "Chose default caps %" GST_PTR_FORMAT " for initial gap", caps);
gst_caps_unref (caps);
return TRUE; return TRUE;