mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-17 10:34:48 +00:00
DOS: yield audio thread even when the ring buffer has space
This commit is contained in:
@@ -170,6 +170,10 @@ static bool DOSSOUNDBLASTER_WaitDevice(SDL_AudioDevice *device)
|
||||
struct SDL_PrivateAudioData *hidden = device->hidden;
|
||||
const int size = hidden->ring_size;
|
||||
|
||||
// Slow mixing can keep the ring below capacity indefinitely. Yield even
|
||||
// when there is room so the cooperative main thread can process events.
|
||||
DOS_Yield();
|
||||
|
||||
for (;;) {
|
||||
// Available space = ring_size - (write - read).
|
||||
// ring_write is ours (audio thread only), ring_read is advanced by
|
||||
|
||||
Reference in New Issue
Block a user