Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2022-02-02 14:39:54 +0300
committerSebastian Dröge <slomo@coaxion.net>2022-02-03 14:04:57 +0300
commit6e28a17280ca394682838bd7bef76f9d7c009251 (patch)
tree6235368880935bb5cf5c58624df4e8716dd473d7 /video/dav1d
parentc35d1cdc0c465c833b98cb19a6f91e14e09c4c9d (diff)
dav1ddec: Don't consider decoding errors as fatal
Instead use the `gst_video::video_decoder_error!` macro for allowing a certain number of consecutive errors before actually failing.
Diffstat (limited to 'video/dav1d')
-rw-r--r--video/dav1d/src/dav1ddec/imp.rs19
1 files changed, 13 insertions, 6 deletions
diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs
index 20976fd3d..0f19c9abf 100644
--- a/video/dav1d/src/dav1ddec/imp.rs
+++ b/video/dav1d/src/dav1ddec/imp.rs
@@ -147,12 +147,19 @@ impl Dav1dDec {
let input_data = input_buffer
.map_readable()
.map_err(|_| gst::FlowError::Error)?;
- let pictures = decoder
- .decode(input_data, frame_number, timestamp, duration, || {})
- .map_err(|e| {
- gst_error!(CAT, "Decoding failed (error code: {})", e);
- gst::FlowError::Error
- })?;
+ let pictures = match decoder.decode(input_data, frame_number, timestamp, duration, || {}) {
+ Ok(pictures) => pictures,
+ Err(err) => {
+ gst_error!(CAT, "Decoding failed (error code: {})", err);
+ return gst_video::video_decoder_error!(
+ element,
+ 1,
+ gst::StreamError::Decode,
+ ["Decoding failed (error code {})", err]
+ )
+ .map(|_| vec![]);
+ }
+ };
let mut decoded_pictures = vec![];
for pic in pictures {