Skip to content

Commit

Permalink
Fix interleave benches
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Nov 12, 2024
1 parent 28312b3 commit 2fc893a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cidre/benches/interleave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down

0 comments on commit 2fc893a

Please # to comment.