vtdec: Use GST_VIDEO_DECODER_ERROR instead of aborting when frame has an ERROR flag

This was already being used in handle_frame() for errors that happen when queueing a frame for decoding,
let's do the same when a frame is flagged with an error in the output callback.
From quick testing, this makes seeking more reliable (previously, it would sometimes cause a decoding error
and shut the whole decoder down due to GST_FLOW_ERROR).

Also manually sets the max error count to actually stop processing if too many errors occur.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6446>
This commit is contained in:
Piotr Brzeziński 2024-06-12 18:28:54 +02:00 committed by GStreamer Marge Bot
parent a5c437c643
commit e5b5d223b4

View file

@ -332,10 +332,10 @@ gst_vtdec_output_loop (GstVtdec * vtdec)
GST_VIDEO_DECODER_STREAM_LOCK (vtdec);
if (frame->flags & VTDEC_FRAME_FLAG_ERROR) {
GST_LOG_OBJECT (vtdec, "ignoring frame %d because of error flag",
frame->system_frame_number);
GST_VIDEO_DECODER_ERROR (vtdec, 1, STREAM, DECODE,
("Got frame %d with an error flag", frame->system_frame_number),
(NULL), ret);
gst_video_decoder_release_frame (decoder, frame);
ret = GST_FLOW_ERROR;
} else if (is_flushing || (frame->flags & VTDEC_FRAME_FLAG_SKIP)) {
GST_LOG_OBJECT (vtdec, "flushing frame %d", frame->system_frame_number);
gst_video_decoder_release_frame (decoder, frame);