[pulseaudio-commits] r1153 - in /trunk/src/pulse: glib-mainloop.c mainloop.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Jul 26 15:39:08 PDT 2006


Author: lennart
Date: Thu Jul 27 00:39:06 2006
New Revision: 1153

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1153&root=pulseaudio&view=rev
Log:
mainloop fixes: when disabling time events when dispatching them, make sure to adjust the cache time event and enabled time event counters

Modified:
    trunk/src/pulse/glib-mainloop.c
    trunk/src/pulse/mainloop.c

Modified: trunk/src/pulse/glib-mainloop.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/glib-mainloop.c?rev=1153&root=pulseaudio&r1=1152&r2=1153&view=diff
==============================================================================
--- trunk/src/pulse/glib-mainloop.c (original)
+++ trunk/src/pulse/glib-mainloop.c Thu Jul 27 00:39:06 2006
@@ -573,7 +573,10 @@
         tvnow.tv_usec = now.tv_usec;
 
         if (pa_timeval_cmp(&t->timeval, &tvnow) <= 0) {
-            t->enabled = 0;
+
+            /* Disable time event */
+            glib_time_restart(t, NULL);
+            
             t->callback(&g->api, t, &t->timeval, t->userdata);
             return TRUE;
         }
@@ -634,6 +637,8 @@
 
     g->n_enabled_defer_events = g->n_enabled_time_events = 0;
     g->io_events_please_scan = g->time_events_please_scan = g->defer_events_please_scan = 0;
+
+    g->cached_next_time_event = NULL;
     
     g_source_attach(&g->source, g->context);
     g_source_set_can_recurse(&g->source, FALSE);

Modified: trunk/src/pulse/mainloop.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/mainloop.c?rev=1153&root=pulseaudio&r1=1152&r2=1153&view=diff
==============================================================================
--- trunk/src/pulse/mainloop.c (original)
+++ trunk/src/pulse/mainloop.c Thu Jul 27 00:39:06 2006
@@ -766,7 +766,12 @@
         if (pa_timeval_cmp(&e->timeval, &now) <= 0) {
             assert(e->callback);
 
-            e->enabled = 0;
+            /* Disable time event */
+            mainloop_time_restart(e, NULL);
+
+            if (m->cached_next_time_event == e)
+                m->cached_next_time_event = NULL;
+            
             e->callback(&m->api, e, &e->timeval, e->userdata);
 
             r++;




More information about the pulseaudio-commits mailing list