diff --git a/playback/src/resampler.rs b/playback/src/resampler.rs index 58cda2d6..3dfd3f3c 100644 --- a/playback/src/resampler.rs +++ b/playback/src/resampler.rs @@ -410,15 +410,15 @@ impl StereoInterleavedResampler { self.latency_pcm } - pub fn resample(&mut self, input_samples: &[f64]) -> Option> { + pub fn resample(&mut self, input_samples: Vec) -> Option> { match &mut self.resampler { // Bypass is basically a no-op. - Resampler::Bypass => Some(input_samples.to_vec()), + Resampler::Bypass => Some(input_samples), Resampler::Worker { left_resampler, right_resampler, } => { - let (left_samples, right_samples) = Self::deinterleave_samples(input_samples); + let (left_samples, right_samples) = Self::deinterleave_samples(&input_samples); left_resampler.resample(left_samples); right_resampler.resample(right_samples); diff --git a/playback/src/sample_pipeline.rs b/playback/src/sample_pipeline.rs index b6bffb89..bae88279 100644 --- a/playback/src/sample_pipeline.rs +++ b/playback/src/sample_pipeline.rs @@ -69,7 +69,7 @@ impl SamplePipeline { pub fn write(&mut self, packet: AudioPacket) -> SinkResult<()> { if let AudioPacket::Samples(samples) = packet { self.resampler - .resample(&samples) + .resample(samples) .map(|processed_samples| self.normaliser.normalise(processed_samples)) .map(|new_packet| self.sink.write(new_packet, &mut self.converter)) .transpose()?;