sdl2: Zero out buffer on sound callback

This commit is contained in:
Ronald Kinard 2014-03-20 20:07:12 -05:00
parent 40de8ea630
commit 3839c2fd58
1 changed files with 3 additions and 4 deletions

View File

@ -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))