[client] audio/pa: fix assertion failure when keep alive playback stops

When the 'keep alive' playback times out, playback is stopped from the
audio callback, resulting in an assertion failure inside PulseAudio as we
try to lock the main loop thread while already inside it.
This commit is contained in:
Chris Spencer 2022-02-20 16:51:33 +00:00 committed by Geoffrey McRae
parent 38340d3497
commit 84b5478b02

View File

@ -313,9 +313,14 @@ static void pulseaudio_stop(void)
if (!pa.sink)
return;
bool needLock = !pa_threaded_mainloop_in_thread(pa.loop);
if (needLock)
pa_threaded_mainloop_lock(pa.loop);
pa_stream_cork(pa.sink, 1, NULL, NULL);
pa.sinkCorked = true;
if (needLock)
pa_threaded_mainloop_unlock(pa.loop);
}