From 180fed4bc48d644fd75d0c2ca89fd4a412710de9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 4 Oct 2014 23:29:52 +0200 Subject: ao_pulse: change suspend circumvention logic Commit 957097 attempted to use PA_STREAM_FAIL_ON_SUSPEND to make ao_pulse exit if the stream was started suspended. Unfortunately, PA_STREAM_FAIL_ON_SUSPEND is active even during playback. If you pause mpv, pulseaudio will close the actual audio device after a while (or something like this), and unpausing won't work. Instead, it will spam "Entity killed" error messages. Undo this change and check for suspended audio manually during init. CC: @mpv-player/stable --- audio/out/ao_pulse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index 09fbfc547c..edbb009729 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -418,6 +418,11 @@ static int init(struct ao *ao) pa_threaded_mainloop_wait(priv->mainloop); } + if (pa_stream_is_suspended(priv->stream)) { + MP_ERR(ao, "The stream is suspended. Bailing out.\n"); + goto unlock_and_fail; + } + pa_threaded_mainloop_unlock(priv->mainloop); return 0; -- cgit v1.2.3