Skip to content

vtdec: Improve error handling in edge cases

Fixes #3425

Just ignoring these kinds of errors seems to be enough, as the faulty frame is (from my testing) always flagged to be skipped anyway. The decoding session does not seem to need to be recreated or anything like that.

Also fixes vtdec being too trigger happy about aborting when an error-flagged frame appears.

vtdec: Handle some errors without stopping the decoder

ReferenceMissingErr is not critical and the simplest solution is to just ignore it. The frame has
the FrameDropped flag set when it occurs, so we can just drop it as usual.
BadDataErr is also not immediately critical, but in its case let's set the ERROR flag,
so the output loop can use GST_VIDEO_DECODER_ERROR to count and error out if it happens too many times.
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).
Edited by Piotr Brzeziński

Merge request reports