audiodecoder: fix ctitical info assertion 'GST_IS_CAPS (dec->priv->ctx.caps)' failed
authorHou Qi <qi.hou@nxp.com>
Wed, 21 Aug 2019 11:04:56 +0000 (19:04 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 2 Sep 2019 11:16:02 +0000 (12:16 +0100)
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.

gst-libs/gst/audio/gstaudiodecoder.c

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