mainloop: fix detection of rt clocks
authorLennart Poettering <lennart@poettering.net>
Fri, 18 Sep 2009 20:14:55 +0000 (22:14 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Sep 2009 20:16:25 +0000 (22:16 +0200)
src/pulse/mainloop.c

index c5443f2..090ac8c 100644 (file)
@@ -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(