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

Conversation

metamuffin
Copy link

image-rs currently errors with Try Again (returned from get_picture) when decoding AVIF images.
This is because dav1d needs to be explicitly flushed via send_data to ensure the stream end is processed.
For reference see dav1d-rs "example" usage
This PR adds a call to send_pending_data when required to do exactly that, fixing the error.

This PR resolves #1954.

I license past and future contributions under the dual MIT/Apache-2.0 license,
allowing licensees to choose either at their option.

@fintelia
Copy link
Contributor

fintelia commented Oct 21, 2023

Should the Error::Again case be handled in a loop? The example seems to repeatedly send data when it gets an error, rather than only doing so once

@metamuffin
Copy link
Author

It appears that for single-frame videos where all data is sent at once this is acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decode AVIF reports image -11 Error Code EDEADLOCK
2 participants