diff options
author | wm4 <wm4@nowhere> | 2015-01-11 04:14:41 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-11 04:19:40 +0100 |
commit | 2c9180f47ba28a2117312da474d14b130baf1589 (patch) | |
tree | bf0be76dec84708b03938c4bfae3e0179dd5333b /audio | |
parent | 3b091995a03f431cc8c14e2e4488af6f66191621 (diff) | |
download | mpv-2c9180f47ba28a2117312da474d14b130baf1589.tar.bz2 mpv-2c9180f47ba28a2117312da474d14b130baf1589.tar.xz |
ao_pulse: exit AO if stream fails
This can for example reproduced by killing the pulseaudio server. If
this happens, just try to reload the AO, instead of breaking everything
forever.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_pulse.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index 1f07189779..d96b9fb98d 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -86,8 +86,12 @@ static void stream_state_cb(pa_stream *s, void *userdata) struct ao *ao = userdata; struct priv *priv = ao->priv; switch (pa_stream_get_state(s)) { - case PA_STREAM_READY: case PA_STREAM_FAILED: + MP_VERBOSE(ao, "Stream failed.\n"); + ao_request_reload(ao); + pa_threaded_mainloop_signal(priv->mainloop, 0); + break; + case PA_STREAM_READY: case PA_STREAM_TERMINATED: pa_threaded_mainloop_signal(priv->mainloop, 0); break; |