summaryrefslogtreecommitdiffstats
path: root/src/pulse/context.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2009-06-20 16:52:41 +0300
committerMarc-André Lureau <marcandre.lureau@gmail.com>2009-06-20 17:29:34 +0300
commite4d914c945c13d23b131d7ba75fbdd03cb6d0043 (patch)
tree19b10b6376a2f28b570d95771363449037f8bfa8 /src/pulse/context.c
parent0955e3d45b6e992308e2d51fcbf28a9f9376f788 (diff)
rtclock: fix issues found by Lennart
Diffstat (limited to 'src/pulse/context.c')
-rw-r--r--src/pulse/context.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pulse/context.c b/src/pulse/context.c
index 0c1810f3..b71659de 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -54,6 +54,8 @@
#include <pulse/utf8.h>
#include <pulse/util.h>
#include <pulse/i18n.h>
+#include <pulse/mainloop.h>
+#include <pulse/timeval.h>
#include <pulsecore/winsock.h>
#include <pulsecore/core-error.h>
@@ -1451,6 +1453,9 @@ pa_time_event* pa_context_rttime_new(pa_context *c, pa_usec_t usec, pa_time_even
pa_assert(c);
pa_assert(c->mainloop);
+ if (usec == PA_USEC_INVALID)
+ return c->mainloop->time_new(c->mainloop, NULL, cb, userdata);
+
pa_timeval_rtstore(&tv, usec, c->use_rtclock);
return c->mainloop->time_new(c->mainloop, &tv, cb, userdata);
@@ -1462,7 +1467,10 @@ void pa_context_rttime_restart(pa_context *c, pa_time_event *e, pa_usec_t usec)
pa_assert(c);
pa_assert(c->mainloop);
- pa_timeval_rtstore(&tv, usec, c->use_rtclock);
-
- c->mainloop->time_restart(e, &tv);
+ if (usec == PA_USEC_INVALID)
+ c->mainloop->time_restart(e, NULL);
+ else {
+ pa_timeval_rtstore(&tv, usec, c->use_rtclock);
+ c->mainloop->time_restart(e, &tv);
+ }
}