From 3839c2fd5835e0441935443cbdd4b599490a1525 Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Thu, 20 Mar 2014 20:07:12 -0500 Subject: [PATCH] sdl2: Zero out buffer on sound callback --- src/sdl2/sdl_sound.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sdl2/sdl_sound.c b/src/sdl2/sdl_sound.c index c11b00597..fe01523e9 100644 --- a/src/sdl2/sdl_sound.c +++ b/src/sdl2/sdl_sound.c @@ -856,6 +856,7 @@ FUNCINLINE static ATTRINLINE void I_UpdateStream16S(Uint8 *stream, int len) if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); + // Mix sounds into the mixing buffer. // Loop over len while (len--) @@ -945,6 +946,7 @@ FUNCINLINE static ATTRINLINE void I_UpdateStream16M(Uint8 *stream, int len) if (Snd_Mutex) SDL_LockMutex(Snd_Mutex); + // Mix sounds into the mixing buffer. // Loop over len while (len--) @@ -1050,10 +1052,7 @@ static void SDLCALL I_UpdateStream(void *userdata, Uint8 *stream, int len) if (!sound_started || !userdata) return; -#if SDL_VERSION_ATLEAST(1,3,0) - if (musicStarted) - memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80 -#endif + memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80 if ((audio.channels != 1 && audio.channels != 2) || (audio.format != AUDIO_S8 && audio.format != AUDIO_S16SYS))