Skip to content

Commit 8cfbf82

Browse files
committed
Fix building previous versions
1 parent c72dccb commit 8cfbf82

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/codec/context.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ impl Context {
102102
(*self.as_mut_ptr()).thread_type = config.kind.into();
103103
(*self.as_mut_ptr()).thread_count = config.count as c_int;
104104
#[cfg(not(feature = "ffmpeg_6_0"))]
105-
{ (*self.as_mut_ptr()).thread_safe_callbacks = if config.safe { 1 } else { 0 }; }
105+
{
106+
(*self.as_mut_ptr()).thread_safe_callbacks = if config.safe { 1 } else { 0 };
107+
}
106108
}
107109
}
108110

src/filter/filter.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ impl Filter {
4747
if ptr.is_null() {
4848
None
4949
} else {
50-
Some(PadIter::new((*self.as_ptr()).inputs, (*self.as_ptr()).nb_inputs as isize))
50+
#[cfg(not(feature = "ffmpeg_6_0"))]
51+
let nb_inputs = avfilter_pad_count((*self.as_ptr()).inputs) as isize;
52+
#[cfg(feature = "ffmpeg_6_0")]
53+
let nb_inputs = (*self.as_ptr()).nb_inputs as isize;
54+
55+
Some(PadIter::new((*self.as_ptr()).inputs, nb_inputs))
5156
}
5257
}
5358
}
@@ -59,7 +64,12 @@ impl Filter {
5964
if ptr.is_null() {
6065
None
6166
} else {
62-
Some(PadIter::new((*self.as_ptr()).outputs, (*self.as_ptr()).nb_outputs as isize))
67+
#[cfg(not(feature = "ffmpeg_6_0"))]
68+
let nb_outputs = avfilter_pad_count((*self.as_ptr()).outputs) as isize;
69+
#[cfg(feature = "ffmpeg_6_0")]
70+
let nb_outputs = (*self.as_ptr()).nb_outputs as isize;
71+
72+
Some(PadIter::new((*self.as_ptr()).outputs, nb_outputs))
6373
}
6474
}
6575
}

0 commit comments

Comments
 (0)