mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
mainloop fixes: when disabling time events when dispatching them, make sure to adjust the cache time event and enabled time event counters
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1153 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
b2ad9a9753
commit
0d7be3148e
2 changed files with 12 additions and 2 deletions
|
|
@ -573,7 +573,10 @@ static gboolean dispatch_func(GSource *source, PA_GCC_UNUSED GSourceFunc callbac
|
|||
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 @@ pa_glib_mainloop *pa_glib_mainloop_new(GMainContext *c) {
|
|||
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue