Commit 3da6a0b20e1591fbb5da6eac3ffa1e22364ed6ff

Ryan C. Gordon 2019-12-03T03:53:06

pulseaudio: don't let FlushCapture get stuck in an infinite loop on shutdown. Fixes Bugzilla #4645.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c
index 53a33f4..e04ef6e 100644
--- a/src/audio/pulseaudio/SDL_pulseaudio.c
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c
@@ -429,7 +429,7 @@ PULSEAUDIO_FlushCapture(_THIS)
         h->capturelen = 0;
     }
 
-    while (SDL_TRUE) {
+    while (SDL_AtomicGet(&this->enabled)) {
         if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY ||
             PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY ||
             PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) {