Ensure PulseAudio's mixing loop is signaled when stopping

This commit is contained in:
Chris Robinson
2015-01-21 22:02:02 -08:00
parent 5cbafaa014
commit 290badea95
+8
View File
@@ -1053,6 +1053,14 @@ static void ALCpulsePlayback_stop(ALCpulsePlayback *self)
return;
self->killNow = AL_TRUE;
/* Signal the main loop in case PulseAudio isn't sending us audio requests
* (e.g. if the device is suspended). We need to lock the mainloop in case
* the mixer is between checking the killNow flag but before waiting for
* the signal.
*/
pa_threaded_mainloop_lock(self->loop);
pa_threaded_mainloop_unlock(self->loop);
pa_threaded_mainloop_signal(self->loop, 0);
althrd_join(self->thread, &res);
pa_threaded_mainloop_lock(self->loop);