mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
sdl2: Zero out buffer on sound callback
This commit is contained in:
parent
40de8ea630
commit
3839c2fd58
1 changed files with 3 additions and 4 deletions
|
@ -856,6 +856,7 @@ FUNCINLINE static ATTRINLINE void I_UpdateStream16S(Uint8 *stream, int len)
|
||||||
|
|
||||||
if (Snd_Mutex) SDL_LockMutex(Snd_Mutex);
|
if (Snd_Mutex) SDL_LockMutex(Snd_Mutex);
|
||||||
|
|
||||||
|
|
||||||
// Mix sounds into the mixing buffer.
|
// Mix sounds into the mixing buffer.
|
||||||
// Loop over len
|
// Loop over len
|
||||||
while (len--)
|
while (len--)
|
||||||
|
@ -945,6 +946,7 @@ FUNCINLINE static ATTRINLINE void I_UpdateStream16M(Uint8 *stream, int len)
|
||||||
|
|
||||||
if (Snd_Mutex) SDL_LockMutex(Snd_Mutex);
|
if (Snd_Mutex) SDL_LockMutex(Snd_Mutex);
|
||||||
|
|
||||||
|
|
||||||
// Mix sounds into the mixing buffer.
|
// Mix sounds into the mixing buffer.
|
||||||
// Loop over len
|
// Loop over len
|
||||||
while (len--)
|
while (len--)
|
||||||
|
@ -1050,10 +1052,7 @@ static void SDLCALL I_UpdateStream(void *userdata, Uint8 *stream, int len)
|
||||||
if (!sound_started || !userdata)
|
if (!sound_started || !userdata)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(1,3,0)
|
memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80
|
||||||
if (musicStarted)
|
|
||||||
memset(stream, 0x00, len); // only work in !AUDIO_U8, that needs 0x80
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((audio.channels != 1 && audio.channels != 2) ||
|
if ((audio.channels != 1 && audio.channels != 2) ||
|
||||||
(audio.format != AUDIO_S8 && audio.format != AUDIO_S16SYS))
|
(audio.format != AUDIO_S8 && audio.format != AUDIO_S16SYS))
|
||||||
|
|
Loading…
Reference in a new issue