#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
-#include <pulsecore/idxset.h>
#include <pulsecore/core-util.h>
#include <pulsecore/log.h>
#include <pulsecore/llist.h>
#include <glib.h>
#include "glib-mainloop.h"
-struct pa_io_event {
+struct pa_io_event {
pa_glib_mainloop *mainloop;
int dead;
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) {
g_assert(e);
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;
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;
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;