diff --git a/cidre/benches/interleave.rs b/cidre/benches/interleave.rs index 87ea932e..e4ba6f41 100644 --- a/cidre/benches/interleave.rs +++ b/cidre/benches/interleave.rs @@ -50,11 +50,15 @@ pub fn criterion_benchmark(c: &mut Criterion) { let from_fmt = av::AudioFormat::with_asbd(&src_asbd).unwrap(); let to_fmt = av::AudioFormat::with_asbd(&dst_asbd).unwrap(); - let mut pcm_a = av::AudioPcmBuf::with_format_and_frame_capacity(&from_fmt, N as u32).unwrap(); - let mut pcm_b = av::AudioPcmBuf::with_format_and_frame_capacity(&to_fmt, N as u32).unwrap(); - - pcm_a.set_frame_length(N as u32); - pcm_b.set_frame_length(N as u32); + let mut pcm_a = av::AudioPcmBuf::with_format(&from_fmt, N as u32).unwrap(); + let mut pcm_b = av::AudioPcmBuf::with_format(&to_fmt, N as u32).unwrap(); + + pcm_a + .set_frame_length(N as u32) + .expect("Failed to set frame length on buf a"); + pcm_b + .set_frame_length(N as u32) + .expect("Failed to set frame length on buf b"); let converter = av::AudioConverter::with_formats(&from_fmt, &to_fmt).unwrap(); c.bench_function("interleave with av::AudioConverter", |b| {