diff options
author | Edward Hervey <edward@centricular.com> | 2020-09-09 08:55:28 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2020-09-14 14:22:24 +0300 |
commit | c6e51f404dc52e00cd92ceae2a251288a46db0b3 (patch) | |
tree | 00e6929be481c508001f344ef8afc0e06c3140ae | |
parent | c77e13b9b389df893f6b1e7ae8e488d7ead8ce5a (diff) |
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: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/90>
-rw-r--r-- | ext/libav/gstavauddec.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); } |