diff options
author | Matthew Gregan <[email protected]> | 2011-12-01 16:31:35 +1300 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2011-12-01 16:31:35 +1300 |
commit | ed04e5a0d6ee369d55181026a495214815880796 (patch) | |
tree | e5c218460402f7b27dc69069bed9e2ab3f23bf74 /src | |
parent | c9f2831c17107217e29f4528ac55370e88d8439f (diff) | |
download | cubeb-ed04e5a0d6ee369d55181026a495214815880796.tar.gz cubeb-ed04e5a0d6ee369d55181026a495214815880796.zip |
alsa: fix refill error handling.
Diffstat (limited to 'src')
-rw-r--r-- | src/cubeb_alsa.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cubeb_alsa.c b/src/cubeb_alsa.c index 7373a87..7724a39 100644 --- a/src/cubeb_alsa.c +++ b/src/cubeb_alsa.c @@ -457,9 +457,8 @@ cubeb_refill_stream(void * stream, struct pollfd * fds, nfds_t nfds) void * p; r = snd_pcm_poll_descriptors_revents(stm->pcm, fds, nfds, &revents); - assert(r >= 0); - - if (revents == POLLERR) { + if (r < 0 || revents == POLLERR) { + stm->waitable = NULL; return XPOLL_WAITABLE_REMOVE; } @@ -473,6 +472,7 @@ cubeb_refill_stream(void * stream, struct pollfd * fds, nfds_t nfds) avail = snd_pcm_avail_update(stm->pcm); } if (avail < 0) { + stm->waitable = NULL; return XPOLL_WAITABLE_REMOVE; } |