Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avif-decoder: Send pending data to dav1d when Err(Again) #2023

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/codecs/avif/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ impl<R: Read> AvifDecoder<R> {
primary_decoder
.send_data(coded.to_vec(), None, None, None)
.map_err(error_map)?;
let picture = primary_decoder.get_picture().map_err(error_map)?;
let picture = match primary_decoder.get_picture() {
Ok(p) => p,
Err(dav1d::Error::Again) => {
primary_decoder.send_pending_data().map_err(error_map)?;
primary_decoder.get_picture().map_err(error_map)?
}
Err(e) => return Err(error_map(e)),
};
let alpha_item = ctx.alpha_item_coded_data().unwrap_or_default();
let alpha_picture = if !alpha_item.is_empty() {
let mut alpha_decoder = dav1d::Decoder::new().map_err(error_map)?;
Expand Down
Loading