mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
audiodecoder: Also negotiate with downstream if needed before handling a GAP event
This commit is contained in:
parent
f74524b58d
commit
0c43005f54
1 changed files with 10 additions and 6 deletions
|
@ -1966,12 +1966,6 @@ gst_audio_decoder_negotiate_default_caps (GstAudioDecoder * 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);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
if (!gst_audio_decoder_negotiate_unlocked (dec)) {
|
|
||||||
GST_INFO_OBJECT (dec, "Failed to negotiate default caps for initial gap");
|
|
||||||
gst_pad_mark_reconfigure (dec->srcpad);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
caps_error:
|
caps_error:
|
||||||
|
@ -1987,6 +1981,7 @@ gst_audio_decoder_handle_gap (GstAudioDecoder * dec, GstEvent * event)
|
||||||
{
|
{
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
GstClockTime timestamp, duration;
|
GstClockTime timestamp, duration;
|
||||||
|
gboolean needs_reconfigure = FALSE;
|
||||||
|
|
||||||
/* Ensure we have caps first */
|
/* Ensure we have caps first */
|
||||||
GST_AUDIO_DECODER_STREAM_LOCK (dec);
|
GST_AUDIO_DECODER_STREAM_LOCK (dec);
|
||||||
|
@ -1997,6 +1992,15 @@ gst_audio_decoder_handle_gap (GstAudioDecoder * dec, GstEvent * event)
|
||||||
("Decoder output not negotiated before GAP event."));
|
("Decoder output not negotiated before GAP event."));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
needs_reconfigure = TRUE;
|
||||||
|
}
|
||||||
|
needs_reconfigure = gst_pad_check_reconfigure (dec->srcpad)
|
||||||
|
|| needs_reconfigure;
|
||||||
|
if (G_UNLIKELY (dec->priv->ctx.output_format_changed || needs_reconfigure)) {
|
||||||
|
if (!gst_audio_decoder_negotiate_unlocked (dec)) {
|
||||||
|
GST_WARNING_OBJECT (dec, "Failed to negotiate with downstream");
|
||||||
|
gst_pad_mark_reconfigure (dec->srcpad);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
|
GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue