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

Broken by libavif 1.0.0 #64

Open
installgentoo opened this issue Apr 14, 2022 · 3 comments
Open

Broken by libavif 1.0.0 #64

installgentoo opened this issue Apr 14, 2022 · 3 comments

Comments

@installgentoo
Copy link

installgentoo commented Apr 14, 2022

Without modifications to

pub fn get_picture(&mut self) -> Result<Picture, Error> {
		unsafe {
			let mut pic: Dav1dPicture = mem::zeroed();
			let mut ret = -11;

			while ret == -11 {
				ret = dav1d_get_picture(self.dec, &mut pic);
			}

			if ret < 0 {
				Err(Error(ret))
			} else {
				let inner = InnerPicture { pic };
				Ok(Picture {
					inner: Arc::new(inner),
				})
			}
		}
	}

Fails to decode with 1.0.0, after returning -11. With modification works fine. Apparently -11 is dav1d's way of spelling EAGAIN, and it expects you to keep requesting the picture. Here's how libheif dealt with this https://github.com/strukturag/libheif/blob/0f8496f22d284e1a69df12fe0b72f375aed31315/libheif/heif_decoder_dav1d.cc#L178-L183

See this for investigation image-rs/image#1647

@sdroege
Copy link
Contributor

sdroege commented Apr 14, 2022

AFAIU if get_picture() returns EAGAIN you have to provide more data

@sdroege
Copy link
Contributor

sdroege commented Apr 14, 2022

Maybe your problem is the non-zero default frame delay now? You can set a lower number when creating the decoder.

@installgentoo
Copy link
Author

I have little to no knowledge of dav1d, just a user of image crate.

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

No branches or pull requests

2 participants