diff --git a/src/codec/context.rs b/src/codec/context.rs index a689b96..07b17c3 100644 --- a/src/codec/context.rs +++ b/src/codec/context.rs @@ -102,7 +102,9 @@ impl Context { (*self.as_mut_ptr()).thread_type = config.kind.into(); (*self.as_mut_ptr()).thread_count = config.count as c_int; #[cfg(not(feature = "ffmpeg_6_0"))] - { (*self.as_mut_ptr()).thread_safe_callbacks = if config.safe { 1 } else { 0 }; } + { + (*self.as_mut_ptr()).thread_safe_callbacks = if config.safe { 1 } else { 0 }; + } } } diff --git a/src/filter/filter.rs b/src/filter/filter.rs index 427a57d..41bfb9b 100644 --- a/src/filter/filter.rs +++ b/src/filter/filter.rs @@ -47,7 +47,12 @@ impl Filter { if ptr.is_null() { None } else { - Some(PadIter::new((*self.as_ptr()).inputs, (*self.as_ptr()).nb_inputs as isize)) + #[cfg(not(feature = "ffmpeg_6_0"))] + let nb_inputs = avfilter_pad_count((*self.as_ptr()).inputs) as isize; + #[cfg(feature = "ffmpeg_6_0")] + let nb_inputs = (*self.as_ptr()).nb_inputs as isize; + + Some(PadIter::new((*self.as_ptr()).inputs, nb_inputs)) } } } @@ -59,7 +64,12 @@ impl Filter { if ptr.is_null() { None } else { - Some(PadIter::new((*self.as_ptr()).outputs, (*self.as_ptr()).nb_outputs as isize)) + #[cfg(not(feature = "ffmpeg_6_0"))] + let nb_outputs = avfilter_pad_count((*self.as_ptr()).outputs) as isize; + #[cfg(feature = "ffmpeg_6_0")] + let nb_outputs = (*self.as_ptr()).nb_outputs as isize; + + Some(PadIter::new((*self.as_ptr()).outputs, nb_outputs)) } } }