From e4d914c945c13d23b131d7ba75fbdd03cb6d0043 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sat, 20 Jun 2009 16:52:41 +0300 Subject: rtclock: fix issues found by Lennart --- src/pulse/context.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/pulse/context.c') 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 #include #include +#include +#include #include #include @@ -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); + } } -- cgit