diff options
author | wm4 <wm4@nowhere> | 2014-10-04 23:29:52 +0200 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-10-11 13:57:03 +0200 |
commit | 180fed4bc48d644fd75d0c2ca89fd4a412710de9 (patch) | |
tree | 942555d66365ba85d8b357abf32e85fdb6c8712c /audio/out/ao_pulse.c | |
parent | fb3bf1ae814da2f307db2f958d80c5085d73fe5f (diff) | |
download | mpv-180fed4bc48d644fd75d0c2ca89fd4a412710de9.tar.bz2 mpv-180fed4bc48d644fd75d0c2ca89fd4a412710de9.tar.xz |
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
Diffstat (limited to 'audio/out/ao_pulse.c')
-rw-r--r-- | audio/out/ao_pulse.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |