diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-06-27 17:50:02 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-06-27 17:50:02 +0000 |
commit | 57dc42709fa258844db05f2042dfffe6ca8ade8b (patch) | |
tree | e292e8ba70cd78c49689002334364ecea21581b5 /src/mainloop.c | |
parent | 1ad4ff1ca446fafb3abe9353a4048893dd3d9b77 (diff) |
many fixes
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@37 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/mainloop.c')
-rw-r--r-- | src/mainloop.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mainloop.c b/src/mainloop.c index a1758c65..8629add2 100644 --- a/src/mainloop.c +++ b/src/mainloop.c @@ -162,11 +162,14 @@ static void dispatch_pollfds(struct pa_mainloop *m) { struct mainloop_source_io *s; for (s = idxset_first(m->io_sources, &index); s; s = idxset_next(m->io_sources, &index)) { - if (s->header.dead || !s->events || !s->pollfd || !s->pollfd->revents) + if (s->header.dead || !s->pollfd || !s->pollfd->revents) continue; - assert(s->pollfd->revents <= s->pollfd->events && s->pollfd->fd == s->fd && s->callback); - s->callback(&m->api, s, s->fd, ((s->pollfd->revents & POLLIN) ? PA_MAINLOOP_API_IO_EVENT_INPUT : 0) | ((s->pollfd->revents & POLLOUT) ? PA_MAINLOOP_API_IO_EVENT_OUTPUT : 0), s->userdata); + assert(s->pollfd->fd == s->fd && s->callback); + s->callback(&m->api, s, s->fd, + ((s->pollfd->revents & (POLLIN|POLLHUP|POLLERR)) ? PA_MAINLOOP_API_IO_EVENT_INPUT : 0) | + ((s->pollfd->revents & POLLOUT) ? PA_MAINLOOP_API_IO_EVENT_OUTPUT : 0), s->userdata); + s->pollfd->revents = 0; } } @@ -212,7 +215,7 @@ static int calc_next_timeout(struct pa_mainloop *m) { if (tmp == 0) return 0; - else if (tmp < t) + else if (t == -1 || tmp < t) t = tmp; } @@ -357,6 +360,7 @@ static void mainloop_cancel_io(struct pa_mainloop_api*a, void* id) { s->header.dead = 1; m->io_sources_scan_dead = 1; + m->rebuild_pollfds = 1; } /* Fixed sources */ |