diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-09-18 22:14:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-09-18 22:16:25 +0200 |
commit | f84d755d6a90ce8752e063a8a04a5d91239eb348 (patch) | |
tree | 22a8783854f76160de371f19c33f91602404856a | |
parent | cd5d6e7b42096272780261492ac9f1e00b6706c8 (diff) |
mainloop: fix detection of rt clocks
-rw-r--r-- | src/pulse/mainloop.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index c5443f23..090ac8c2 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( |