* 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
This commit is contained in:
Lennart Poettering 2006-04-12 22:45:57 +00:00
parent 853caf1274
commit bf88854e60
3 changed files with 81 additions and 86 deletions

View file

@ -91,30 +91,31 @@ 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 (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));
}
for (;;) {
int r;
if ((r = pa_mainloop_iterate(p->mainloop, 0, 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)) {
if (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;