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.
This commit is contained in:
wm4 2017-02-27 19:09:42 +01:00
parent 6ace32100a
commit 6028244160
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}