diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-04-12 22:45:57 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-04-12 22:45:57 +0000 |
commit | bf88854e60500f251fefbde8ab678b9d93280201 (patch) | |
tree | 7562aaf230b17531bb3f8d4346002e569091ebf8 /src/polyp/simple.c | |
parent | 853caf12740ed3ff4f4c64c2cb458cb0cc635d25 (diff) |
* dispatch defer events in pa_mainloop_dispatch() and not already in pa_mainloop_prepare()
* fix the "timeout" parameter of pa_mainloop_prepare()
* remove pa_mainloop_deferred_pending() and update the simple API accordingly
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@690 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/polyp/simple.c')
-rw-r--r-- | src/polyp/simple.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/src/polyp/simple.c b/src/polyp/simple.c index f48c0b17..dbf7a325 100644 --- a/src/polyp/simple.c +++ b/src/polyp/simple.c @@ -91,31 +91,32 @@ static int iterate(pa_simple *p, int block, int *rerror) { if (check_error(p, rerror) < 0) return -1; - - if (!block && !pa_context_is_pending(p->context)) - return 0; - - do { - if (pa_mainloop_iterate(p->mainloop, 1, NULL) < 0) { - if (rerror) - *rerror = PA_ERR_INTERNAL; - return -1; - } - if (check_error(p, rerror) < 0) - return -1; - - } while (pa_context_is_pending(p->context)); + if (block || pa_context_is_pending(p->context)) { + do { + if (pa_mainloop_iterate(p->mainloop, 1, NULL) < 0) { + if (rerror) + *rerror = PA_ERR_INTERNAL; + return -1; + } + + if (check_error(p, rerror) < 0) + return -1; + } while (pa_context_is_pending(p->context)); + } - - while (pa_mainloop_deferred_pending(p->mainloop)) { + for (;;) { + int r; - if (pa_mainloop_iterate(p->mainloop, 0, NULL) < 0) { + if ((r = pa_mainloop_iterate(p->mainloop, 0, NULL)) < 0) { if (rerror) *rerror = PA_ERR_INTERNAL; return -1; } + if (r == 0) + break; + if (check_error(p, rerror) < 0) return -1; } |