From 2e305e8f110ec4674c85aca6a5968992e5f6e808 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sun, 1 Aug 2021 11:05:45 +0800 Subject: [PATCH] fix on rubato --- src/common.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common.rs b/src/common.rs index bbb641f53..486579876 100644 --- a/src/common.rs +++ b/src/common.rs @@ -149,15 +149,15 @@ pub fn resample_channels( if let Ok(x) = resampler.process(&waves_in) { if x.is_empty() { Vec::new() - } else if waves_in.len() == 2 { - waves_in[0] + } else if x.len() == 2 { + x[0] .chunks(1) - .zip(waves_in[1].chunks(1)) + .zip(x[1].chunks(1)) .flat_map(|(a, b)| a.into_iter().chain(b)) .map(|x| *x as f32) .collect() } else { - waves_in[0].iter().map(|x| *x as f32).collect() + x[0].iter().map(|x| *x as f32).collect() } } else { Vec::new()