Fix ffmpeg 4.x

This commit is contained in:
Josh Holmer 2023-03-07 13:29:18 -05:00
parent 3954c3002d
commit e3d3c4a11e
3 changed files with 41 additions and 9 deletions

View File

@ -1,3 +1,15 @@
## Version 1.2.1
- Fix ffmpeg 4.x support that was broken in 1.2.0
## Version 1.2.0
- Add ffmpeg 6.0 support
## _sys_ Version 1.1.0
- Add ffmpeg 6.0 support
## _sys_ Version 1.0.2
- Fix building against clang 16 by using latest bindgen crate

View File

@ -1,6 +1,6 @@
[package]
name = "ffmpeg-the-third"
version = "1.2.0+ffmpeg-6.0.0"
version = "1.2.1+ffmpeg-6.0.0"
build = "build.rs"
authors = ["meh. <meh@schizofreni.co>", "Zhiming Wang <i@zhimingwang.org>"]

View File

@ -47,11 +47,21 @@ impl Filter {
if ptr.is_null() {
None
} else {
#[cfg(feature = "ffmpeg_5_0")]
{
Some(PadIter::new(
(*self.as_ptr()).inputs,
(*self.as_ptr()).nb_inputs as isize,
))
}
#[cfg(not(feature = "ffmpeg_5_0"))]
{
Some(PadIter::new(
(*self.as_ptr()).inputs,
(*self.as_ptr()).inputs as isize,
))
}
}
}
}
@ -62,11 +72,21 @@ impl Filter {
if ptr.is_null() {
None
} else {
#[cfg(feature = "ffmpeg_5_0")]
{
Some(PadIter::new(
(*self.as_ptr()).outputs,
(*self.as_ptr()).nb_outputs as isize,
))
}
#[cfg(not(feature = "ffmpeg_5_0"))]
{
Some(PadIter::new(
(*self.as_ptr()).outputs,
(*self.as_ptr()).outputs as isize,
))
}
}
}
}