diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2023-01-23 11:46:38 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-01-23 11:46:38 +0300 |
commit | e0e63dd4da91ac956db4306adf7c1d05593cadd8 (patch) | |
tree | 063adb0debec4869555a868799fbdb0dae9f1df3 /video | |
parent | 2c386fb792a08c3944c9272b361ed54acf86efc8 (diff) |
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1057>
Diffstat (limited to 'video')
-rw-r--r-- | video/dav1d/src/dav1ddec/imp.rs | 12 |
1 files changed, 11 insertions, 1 deletions
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); |