Commit 420e2298 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

audioencoder/decoder: Mark pads as requiring reconfiguration again if negotiation fails

Otherwise we might end up in non-optimal configuration, especially
when a flush happened during reconfiguration.
parent 35ee4b05
......@@ -1036,6 +1036,7 @@ gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf,
(GST_AUDIO_INFO_IS_VALID (&ctx->info)
&& gst_pad_check_reconfigure (dec->srcpad)))) {
if (!gst_audio_decoder_negotiate (dec)) {
gst_pad_mark_reconfigure (dec->srcpad);
if (GST_PAD_IS_FLUSHING (dec->srcpad))
ret = GST_FLOW_FLUSHING;
else
......@@ -3001,6 +3002,7 @@ gst_audio_decoder_allocate_output_buffer (GstAudioDecoder * dec, gsize size)
&& gst_pad_check_reconfigure (dec->srcpad)))) {
if (!gst_audio_decoder_negotiate (dec)) {
GST_INFO_OBJECT (dec, "Failed to negotiate, fallback allocation");
gst_pad_mark_reconfigure (dec->srcpad);
goto fallback;
}
}
......
......@@ -627,6 +627,7 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
if (G_UNLIKELY (ctx->output_caps_changed
|| gst_pad_check_reconfigure (enc->srcpad))) {
if (!gst_audio_encoder_negotiate (enc)) {
gst_pad_mark_reconfigure (enc->srcpad);
if (GST_PAD_IS_FLUSHING (enc->srcpad))
ret = GST_FLOW_FLUSHING;
else
......@@ -2714,6 +2715,7 @@ gst_audio_encoder_allocate_output_buffer (GstAudioEncoder * enc, gsize size)
&& gst_pad_check_reconfigure (enc->srcpad)))) {
if (!gst_audio_encoder_negotiate (enc)) {
GST_INFO_OBJECT (enc, "Failed to negotiate, fallback allocation");
gst_pad_mark_reconfigure (enc->srcpad);
goto fallback;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment