]> code.delx.au - pulseaudio/blobdiff - src/pulse/glib-mainloop.c
volume: Increase PA_SW_VOLUME_SNPRINT_DB_MAX
[pulseaudio] / src / pulse / glib-mainloop.c
index 35c9c6a2d1a92d7665ff8b3557f94ecf78f0d521..34f355673392839b359293cbc4ffba1e6fc6c80a 100644 (file)
@@ -328,13 +328,15 @@ static void glib_time_restart(pa_time_event*e, const struct timeval *tv) {
     if ((e->enabled = !!tv))
         e->timeval = *tv;
 
+    if (e->mainloop->cached_next_time_event == e)
+        e->mainloop->cached_next_time_event = NULL;
+
     if (e->mainloop->cached_next_time_event && e->enabled) {
         g_assert(e->mainloop->cached_next_time_event->enabled);
 
         if (pa_timeval_cmp(tv, &e->mainloop->cached_next_time_event->timeval) < 0)
             e->mainloop->cached_next_time_event = e;
-    } else if (e->mainloop->cached_next_time_event == e)
-        e->mainloop->cached_next_time_event = NULL;
+    }
 }
 
 static void glib_time_free(pa_time_event *e) {
@@ -489,7 +491,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) {
         t = find_next_time_event(g);
         g_assert(t);
 
-        g_source_get_current_time(source, &now);
+        g_get_current_time(&now);
         tvnow.tv_sec = now.tv_sec;
         tvnow.tv_usec = now.tv_usec;
 
@@ -520,7 +522,7 @@ static gboolean check_func(GSource *source) {
         t = find_next_time_event(g);
         g_assert(t);
 
-        g_source_get_current_time(source, &now);
+        g_get_current_time(&now);
         tvnow.tv_sec = now.tv_sec;
         tvnow.tv_usec = now.tv_usec;
 
@@ -565,7 +567,7 @@ static gboolean dispatch_func(GSource *source, GSourceFunc callback, gpointer us
         t = find_next_time_event(g);
         g_assert(t);
 
-        g_source_get_current_time(source, &now);
+        g_get_current_time(&now);
         tvnow.tv_sec = now.tv_sec;
         tvnow.tv_usec = now.tv_usec;