mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
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:
parent
43a04650f1
commit
f9c7321670
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue