diff options
author | wm4 <wm4@nowhere> | 2014-10-04 23:29:52 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-04 23:30:07 +0200 |
commit | 0d4e245de7be910df9f1293bba1faf421bd73376 (patch) | |
tree | 594167ead805f74134b2491655649242a6cbc9cc /audio | |
parent | 80e10b005840da8e4b8274a2c27e00fbe246a0d8 (diff) | |
download | mpv-0d4e245de7be910df9f1293bba1faf421bd73376.tar.bz2 mpv-0d4e245de7be910df9f1293bba1faf421bd73376.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')
-rw-r--r-- | audio/out/ao_pulse.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index 9cc24d99a4..edbb009729 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -400,7 +400,7 @@ static int init(struct ao *ao) .fragsize = -1, }; - int flags = PA_STREAM_NOT_MONOTONIC | PA_STREAM_FAIL_ON_SUSPEND; + int flags = PA_STREAM_NOT_MONOTONIC; if (!priv->cfg_latency_hacks) flags |= PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE; @@ -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; |