From f84d755d6a90ce8752e063a8a04a5d91239eb348 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Sep 2009 22:14:55 +0200 Subject: [PATCH] mainloop: fix detection of rt clocks --- src/pulse/mainloop.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index c5443f23e..090ac8c2a 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -324,16 +324,15 @@ static pa_usec_t make_rt(const struct timeval *tv, pa_bool_t *use_rtclock) { return PA_USEC_INVALID; } - if (tv->tv_usec & PA_TIMEVAL_RTCLOCK) { - ttv = *tv; + ttv = *tv; + *use_rtclock = !!(ttv.tv_usec & PA_TIMEVAL_RTCLOCK); + + if (*use_rtclock) ttv.tv_usec &= ~PA_TIMEVAL_RTCLOCK; - tv = pa_rtclock_from_wallclock(&ttv); + else + pa_rtclock_from_wallclock(&ttv); - *use_rtclock = TRUE; - } else - *use_rtclock = FALSE; - - return pa_timeval_load(tv); + return pa_timeval_load(&ttv); } static pa_time_event* mainloop_time_new(