From 586e9f1929b8f3c8c4cfd12333065f4c334680d9 Mon Sep 17 00:00:00 2001 From: JasonLG1979 Date: Thu, 22 Jun 2023 01:39:54 -0500 Subject: [PATCH] Fix clippy lint round 1000 + a small bug fix --- playback/src/audio_backend/portaudio.rs | 9 ++++++--- src/main.rs | 14 ++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/playback/src/audio_backend/portaudio.rs b/playback/src/audio_backend/portaudio.rs index 4a07fb53..178c8386 100644 --- a/playback/src/audio_backend/portaudio.rs +++ b/playback/src/audio_backend/portaudio.rs @@ -86,10 +86,13 @@ impl<'a> Open for PortAudioSink<'a> { $sink(None, params, $sample_rate) }}; } + + let sample_rate = sample_rate as f64; + match format { - AudioFormat::F32 => open_sink!(Self::F32, f32, sample_rate as f64), - AudioFormat::S32 => open_sink!(Self::S32, i32, sample_rate as f64), - AudioFormat::S16 => open_sink!(Self::S16, i16, sample_rate as f64), + AudioFormat::F32 => open_sink!(Self::F32, f32, sample_rate), + AudioFormat::S32 => open_sink!(Self::S32, i32, sample_rate), + AudioFormat::S16 => open_sink!(Self::S16, i16, sample_rate), _ => { unimplemented!("PortAudio currently does not support {format:?} output") } diff --git a/src/main.rs b/src/main.rs index 24ab4b3c..95e2f6eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1562,12 +1562,7 @@ fn get_setup() -> Setup { NORMALISATION_ATTACK_SHORT, &attack, valid_values, - &sample_rate - .normalisation_coefficient_to_duration( - player_default_config.normalisation_attack_cf, - ) - .as_millis() - .to_string(), + "5", ); exit(1); @@ -1595,12 +1590,7 @@ fn get_setup() -> Setup { NORMALISATION_RELEASE_SHORT, &release, valid_values, - &sample_rate - .normalisation_coefficient_to_duration( - player_default_config.normalisation_release_cf, - ) - .as_millis() - .to_string(), + "100", ); exit(1);