Переглянути джерело

DOS: yield audio thread even when the ring buffer has space

x0r 1 тиждень тому
батько
коміт
ce85ee87f6
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      src/audio/dos/SDL_dosaudio_sb.c

+ 4 - 0
src/audio/dos/SDL_dosaudio_sb.c

@@ -170,6 +170,10 @@ static bool DOSSOUNDBLASTER_WaitDevice(SDL_AudioDevice *device)
     struct SDL_PrivateAudioData *hidden = device->hidden;
     struct SDL_PrivateAudioData *hidden = device->hidden;
     const int size = hidden->ring_size;
     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 (;;) {
     for (;;) {
         // Available space = ring_size - (write - read).
         // Available space = ring_size - (write - read).
         // ring_write is ours (audio thread only), ring_read is advanced by
         // ring_write is ours (audio thread only), ring_read is advanced by