summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-27 19:09:42 +0100
committerwm4 <wm4@nowhere>2017-02-27 19:09:42 +0100
commit6028244160b75555b3d34aebc1274d25602f99fb (patch)
treeeceb3b3aba2d24d84385bb393f31b8d46c9d57e9 /audio
parent6ace32100a32bb6727b77da5f5abedee5285449d (diff)
downloadmpv-6028244160b75555b3d34aebc1274d25602f99fb.tar.bz2
mpv-6028244160b75555b3d34aebc1274d25602f99fb.tar.xz
ao_alsa: close audio device if polling returns POLLERR
This is apparently what happens in this situation: Turn off display with DPMS, turn back on with DPMS. MPV is hung. See #4189.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_alsa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 5b07fb2546..ced2ed2325 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -1124,8 +1124,10 @@ static int audio_wait(struct ao *ao, pthread_mutex_t *lock)
err = snd_pcm_poll_descriptors_revents(p->alsa, fds, num_fds, &revents);
CHECK_ALSA_ERROR("cannot read poll events");
- if (revents & POLLERR)
+ if (revents & POLLERR) {
+ check_device_present(ao, -ENODEV);
return -1;
+ }
if (revents & POLLOUT)
return 0;
}