Fix infinite loop in snd_pcm_wait()

Fix possible infinite loop in snd_pcm_wait() with direct plugins
when XRUN occurs during poll.
This commit is contained in:
Takashi Iwai 2006-02-20 19:34:45 +00:00
parent 43a04650f1
commit f9c7321670

View file

@ -569,6 +569,15 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in
if (empty) {
snd_pcm_direct_clear_timer_queue(dmix);
events &= ~(POLLOUT|POLLIN);
/* additional check */
switch (snd_pcm_state(pcm)) {
case SND_PCM_STATE_XRUN:
case SND_PCM_STATE_SUSPENDED:
events |= POLLERR;
break;
default:
break;
}
}
break;
}