sdl2: Fix broken audio in MVE playback.

This doesn't fix the audio gaps, just the static introduced in the SDL2 port.

SDL2 does not initialize the audio callback's buffer, unlike SDL 1.2, under
the assumption the callback is going to fully write it anyhow. But since
the movie player wants to mix against the current contents of the buffer,
we need to explicitly initialize it to silence first.
This commit is contained in:
Ryan C. Gordon 2024-05-05 10:04:58 -04:00
parent ff571ed7dd
commit 65b1a7dc3b
No known key found for this signature in database
GPG Key ID: FA148B892AB48044

View File

@ -775,6 +775,8 @@ static void LinuxSoundMixBuffersIntoMain(int len) {
}
static void LinuxSoundThreadHandler(void *unused, Uint8 *stream, int len) {
SDL_memset(stream, '\0', len);
LnxBuffers[0]->buffer = stream;
LnxBuffers[0]->buffer_len = len;
LnxBuffers[0]->play_cursor = 0;