Linux: Correct misuse of SDL_MixAudio

memset needs to be used even with full volume.
This commit is contained in:
Campbell Barton 2016-11-27 11:45:45 +11:00
parent 9eafa5730c
commit cbcab0b54e

View file

@ -133,12 +133,8 @@ static void sdl_fill_audio(void *udata, Uint8 *stream, int len) {
}
/* Mix as much data as possible */
len = (len > audio_len ? audio_len : len);
// Mix with silence if we're not at full volume
if (_this->m_volume != SDL_MIX_MAXVOLUME) {
SDL_memset(stream, 0, len);
}
len = min(audio_len, len);
SDL_memset(stream, 0, len);
SDL_MixAudio(stream, (Uint8 *)myData->entireFileBuffer + myData->byteOffset,
len, _this->m_volume);
myData->byteOffset += len;