From c6e51f404dc52e00cd92ceae2a251288a46db0b3 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 9 Sep 2020 08:55:28 +0200 Subject: avauddec: Avoid dropping non-OK flow return When sucessfully finishing out frames (or finishing configuration), we must make sure we don't override any failing GstFlowReturn that might have been detected previously. Failure to do this would result in not propagating not-linked, flushing, etc... Part-of: --- ext/libav/gstavauddec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c index 756f92d..f43bfad 100644 --- a/ext/libav/gstavauddec.c +++ b/ext/libav/gstavauddec.c @@ -722,7 +722,10 @@ gst_ffmpegauddec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf) } } while (got_frame); - if (is_header || got_any_frames) { + /* Only override the flow return value if previously did have a GST_FLOW_OK. + * Failure to do this would result in skipping downstream issues caught in + * earlier steps. */ + if (ret == GST_FLOW_OK && (is_header || got_any_frames)) { ret = gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (ffmpegdec), NULL, 1); } -- cgit v1.2.1