From 435c6ae5b00c35211422ce1067f540b572756771 Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Fri, 12 Feb 2021 13:49:25 +0200 Subject: [PATCH] audio/audio_converter: mix-matrix contains floats, not doubles --- gstreamer-audio/src/audio_converter.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gstreamer-audio/src/audio_converter.rs b/gstreamer-audio/src/audio_converter.rs index 47d2e1261..ec4bd8a85 100644 --- a/gstreamer-audio/src/audio_converter.rs +++ b/gstreamer-audio/src/audio_converter.rs @@ -122,7 +122,7 @@ impl AudioConverterConfig { .unwrap_or(crate::AudioResamplerMethod::BlackmanNuttall) } - pub fn set_mix_matrix>(&mut self, v: &[T]) { + pub fn set_mix_matrix>(&mut self, v: &[T]) { let length = v.get(0).map(|v| v.as_ref().len()).unwrap_or(0); let array = gst::Array::from_owned( v.iter() @@ -141,7 +141,7 @@ impl AudioConverterConfig { self.0.set("GstAudioConverter.mix-matrix", &array); } - pub fn get_mix_matrix(&self) -> Vec> { + pub fn get_mix_matrix(&self) -> Vec> { self.0 .get_optional::("GstAudioConverter.mix-matrix") .expect("Wrong type") @@ -158,7 +158,7 @@ impl AudioConverterConfig { array .as_slice() .iter() - .map(|val| val.get_some::().expect("Wrong type")) + .map(|val| val.get_some::().expect("Wrong type")) .collect::>() }) .collect::>() @@ -173,7 +173,7 @@ mod tests { #[test] fn test_mix_matrix() { - const MATRIX: &[&[f64]] = &[&[1.2, 0.3], &[0.2, 0.8]]; + const MATRIX: &[&[f32]] = &[&[1.2, 0.3], &[0.2, 0.8]]; gst::init().unwrap();