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>
This commit is contained in:
Edward Hervey 2020-09-09 08:55:28 +02:00 committed by Sebastian Dröge
parent c77e13b9b3
commit c6e51f404d

View file

@ -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);
}