pulseaudio: don't let FlushCapture get stuck in an infinite loop on shutdown.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 03 Dec 2019 03:53:06 -0500
changeset 13308fb600198ec12
parent 13307 805a3b5cdcc8
child 13309 a72231930f12
pulseaudio: don't let FlushCapture get stuck in an infinite loop on shutdown.

Fixes Bugzilla #4645.
src/audio/pulseaudio/SDL_pulseaudio.c
     1.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.c	Tue Dec 03 03:07:34 2019 -0500
     1.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Tue Dec 03 03:53:06 2019 -0500
     1.3 @@ -429,7 +429,7 @@
     1.4          h->capturelen = 0;
     1.5      }
     1.6  
     1.7 -    while (SDL_TRUE) {
     1.8 +    while (SDL_AtomicGet(&this->enabled)) {
     1.9          if (PULSEAUDIO_pa_context_get_state(h->context) != PA_CONTEXT_READY ||
    1.10              PULSEAUDIO_pa_stream_get_state(h->stream) != PA_STREAM_READY ||
    1.11              PULSEAUDIO_pa_mainloop_iterate(h->mainloop, 1, NULL) < 0) {