video: decoder: ffmpeg: handle INVALIDDATA in try_receive_frame()

The INVALIDDATA error can be returned by both try_send_packet() and
try_receive_frame(). In both cases we should just skip the invalid input
until the decoder can catch up with something that makes sense.

TEST=arc.VideoDecodeAccel.h264_vm unconditionally passes on Hatch

Change-Id: I4467b50c35fb36562a4b662d14071afcf02f1eb2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3924583
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
This commit is contained in:
Alexandre Courbot 2022-09-28 16:36:09 +09:00 committed by crosvm LUCI
parent b74bc68371
commit 753916a7d3

View file

@ -330,6 +330,11 @@ impl FfmpegDecoderSession {
self.context.reset();
Ok(false)
}
// If we got invalid data, keep going in hope that we will catch a valid state later.
Err(AvError(AVERROR_INVALIDDATA)) => {
warn!("Invalid data in stream, ignoring...");
Ok(false)
}
Err(av_err) => {
// This is a decoding error, so signal it using a `NotifyError` event to reflect the
// same asynchronous flow as a hardware decoder would.