From 313242a47a9baed4b47c8c5add6eae3ef0f852dc Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Sat, 7 Jan 2023 09:54:52 +0100
Subject: [PATCH] Use SDL_PlayAudioDevice / SDL_PauseAudioDevice
---
src/mixer.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/mixer.c b/src/mixer.c
index eebdd47e..1476efce 100644
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -532,7 +532,7 @@ int Mix_OpenAudioDevice(int frequency, Uint16 format, int nchannels, int chunksi
open_music(&mixer);
audio_opened = 1;
- SDL_PauseAudioDevice(audio_device, 0);
+ SDL_PlayAudioDevice(audio_device);
return(0);
}
@@ -547,7 +547,11 @@ int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int chunksize)
/* Pause or resume the audio streaming */
void Mix_PauseAudio(int pause_on)
{
- SDL_PauseAudioDevice(audio_device, pause_on);
+ if (pause_on) {
+ SDL_PauseAudioDevice(audio_device);
+ } else {
+ SDL_PlayAudioDevice(audio_device);
+ }
Mix_LockAudio();
pause_async_music(pause_on);
Mix_UnlockAudio();