summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2020-09-09 08:55:28 +0200
committerSebastian Dröge <sebastian@centricular.com>2020-09-14 14:22:24 +0300
commitc6e51f404dc52e00cd92ceae2a251288a46db0b3 (patch)
tree00e6929be481c508001f344ef8afc0e06c3140ae
parentc77e13b9b389df893f6b1e7ae8e488d7ead8ce5a (diff)
downloadgst-libav-c6e51f404dc52e00cd92ceae2a251288a46db0b3.tar.gz
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.c5
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);
}