From 7ae88457e08a04967bcb07ca21385959e6114916 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Mon, 24 Jul 2023 16:44:23 +0100
Subject: [PATCH] chore: improved on audio signature

---
 frontends/sdl/src/audio.rs | 6 +++---
 frontends/sdl/src/main.rs  | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/frontends/sdl/src/audio.rs b/frontends/sdl/src/audio.rs
index 8b628d04..5284f5fa 100644
--- a/frontends/sdl/src/audio.rs
+++ b/frontends/sdl/src/audio.rs
@@ -9,12 +9,12 @@ pub struct Audio {
 }
 
 impl Audio {
-    pub fn new(sdl: &Sdl, freq: Option<i32>, channels: Option<u8>, samples: Option<u16>) -> Self {
+    pub fn new(sdl: &Sdl, freq: i32, channels: u8, samples: Option<u16>) -> Self {
         let audio_subsystem = sdl.audio().unwrap();
 
         let desired_spec = AudioSpecDesired {
-            freq: Some(freq.unwrap_or(44100)),
-            channels: Some(channels.unwrap_or(2)),
+            freq: Some(freq),
+            channels: Some(channels),
             samples: Some(samples.unwrap_or(4096)),
         };
 
diff --git a/frontends/sdl/src/main.rs b/frontends/sdl/src/main.rs
index 72afac1c..01e3e2cb 100644
--- a/frontends/sdl/src/main.rs
+++ b/frontends/sdl/src/main.rs
@@ -207,8 +207,8 @@ impl Emulator {
     pub fn start_audio(&mut self, sdl: &Sdl) {
         self.audio = Some(Audio::new(
             sdl,
-            Some(self.system.audio_sampling_rate() as i32),
-            Some(self.system.audio_channels()),
+            self.system.audio_sampling_rate() as i32,
+            self.system.audio_channels(),
             None,
         ));
     }
-- 
GitLab