aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-01-21 22:02:02 -0800
committerChris Robinson <[email protected]>2015-01-21 22:02:02 -0800
commit290badea95fb7a971fbf6efdf792cc322128098a (patch)
tree61d1c236fa3911c84c77c3bc2529704f40486fef /Alc/backends/pulseaudio.c
parent5cbafaa014062ce704b59604f6aae40837b7c670 (diff)
Ensure PulseAudio's mixing loop is signaled when stopping
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-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);