From 6028244160b75555b3d34aebc1274d25602f99fb Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 27 Feb 2017 19:09:42 +0100 Subject: 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. --- audio/out/ao_alsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'audio/out/ao_alsa.c') 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; } -- cgit v1.2.3