[polypaudio-commits] r822 - /trunk/src/polyp/mainloop.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Apr 30 16:33:08 PDT 2006


Author: lennart
Date: Mon May  1 01:33:04 2006
New Revision: 822

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=822&root=polypaudio&view=rev
Log:
* make sure the wakeup fd is polled on wven when no other fd is registered for polling
* initialize mainloop return value to -1
* some optimizations

Modified:
    trunk/src/polyp/mainloop.c

Modified: trunk/src/polyp/mainloop.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/mainloop.c?rev=822&root=polypaudio&r1=821&r2=822&view=diff
==============================================================================
--- trunk/src/polyp/mainloop.c (original)
+++ trunk/src/polyp/mainloop.c Mon May  1 01:33:04 2006
@@ -301,10 +301,7 @@
     m = a->userdata;
     assert(a == &m->api);
 
-    m->quit = 1;
-    m->retval = retval;
-
-    pa_mainloop_wakeup(m);
+    pa_mainloop_quit(m, retval);
 }
     
 static const pa_mainloop_api vtable = {
@@ -355,7 +352,8 @@
     m->io_events_scan_dead = m->defer_events_scan_dead = m->time_events_scan_dead = 0;
     
     m->pollfds = NULL;
-    m->max_pollfds = m->n_pollfds = m->rebuild_pollfds = 0;
+    m->max_pollfds = m->n_pollfds = 0;
+    m->rebuild_pollfds = 1;
 
     m->quit = m->retval = 0;
 
@@ -368,6 +366,8 @@
 
     m->poll_func = NULL;
     m->poll_func_userdata = NULL;
+
+    m->retval = -1;
     
     return m;
 }
@@ -419,7 +419,7 @@
 
 void pa_mainloop_free(pa_mainloop* m) {
     int all = 1;
-    assert(m && (m->state != STATE_POLLING));
+    assert(m);
 
     pa_idxset_foreach(m->io_events, io_foreach, &all);
     pa_idxset_foreach(m->time_events, time_foreach, &all);
@@ -772,10 +772,12 @@
         return 0;
 }
 
-void pa_mainloop_quit(pa_mainloop *m, int r) {
-    assert(m);
+void pa_mainloop_quit(pa_mainloop *m, int retval) {
+    assert(m);
+
+    m->quit = 1;
+    m->retval = retval;
     pa_mainloop_wakeup(m);
-    m->quit = r;
 }
 
 pa_mainloop_api* pa_mainloop_get_api(pa_mainloop*m) {




More information about the pulseaudio-commits mailing list