mirror of https://github.com/mpv-player/mpv
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:
parent
6ace32100a
commit
6028244160
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue