mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-26 13:31:00 +00:00
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.
This commit is contained in:
parent
c35d1cdc0c
commit
6e28a17280
1 changed files with 13 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue