From e0e63dd4da91ac956db4306adf7c1d05593cadd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 23 Jan 2023 10:46:38 +0200 Subject: [PATCH] dav1d: Don't treat any kind of bitstream error immediately as fatal Instead use the videodecoder error handling to allow up to max-errors consecutive decoding errors, i.e. infinite by default in 1.22 and newer. Part-of: --- video/dav1d/src/dav1ddec/imp.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index 9bd94222..62ed9196 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -208,10 +208,20 @@ impl Dav1dDec { gst::trace!(CAT, imp: self, "Decoder returned OK"); Ok(std::ops::ControlFlow::Break(())) } - Err(err) if err.is_again() => { + Err(dav1d::Error::Again) => { gst::trace!(CAT, imp: self, "Decoder returned EAGAIN"); Ok(std::ops::ControlFlow::Continue(())) } + Err(dav1d::Error::InvalidArgument) => { + gst::trace!(CAT, imp: self, "Decoder returned EINVAL"); + gst_video::video_decoder_error!( + &*self.obj(), + 1, + gst::LibraryError::Encode, + ["Bitstream error"] + )?; + Ok(std::ops::ControlFlow::Continue(())) + } Err(err) => { gst::error!(CAT, "Sending data failed (error code: {})", err); self.obj().release_frame(frame);