From: Lennart Poettering Date: Fri, 18 Sep 2009 20:14:55 +0000 (+0200) Subject: mainloop: fix detection of rt clocks X-Git-Tag: v0.9.18~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f84d755d6a90ce8752e063a8a04a5d91239eb348;p=platform%2Fupstream%2Fpulseaudio.git mainloop: fix detection of rt clocks --- diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index c5443f2..090ac8c 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_usec &= ~PA_TIMEVAL_RTCLOCK; - tv = pa_rtclock_from_wallclock(&ttv); + ttv = *tv; + *use_rtclock = !!(ttv.tv_usec & PA_TIMEVAL_RTCLOCK); - *use_rtclock = TRUE; - } else - *use_rtclock = FALSE; + if (*use_rtclock) + ttv.tv_usec &= ~PA_TIMEVAL_RTCLOCK; + else + pa_rtclock_from_wallclock(&ttv); - return pa_timeval_load(tv); + return pa_timeval_load(&ttv); } static pa_time_event* mainloop_time_new(