aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/pulseaudio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index ae7e4e85..f8761c91 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -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);