[pulseaudio-commits] r1961 - /branches/lennart/src/pulsecore/rtclock.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Oct 27 15:05:24 PDT 2007


Author: lennart
Date: Sun Oct 28 00:05:20 2007
New Revision: 1961

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1961&root=pulseaudio&view=rev
Log:
minor cleanup

Modified:
    branches/lennart/src/pulsecore/rtclock.c

Modified: branches/lennart/src/pulsecore/rtclock.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/rtclock.c?rev=1961&root=pulseaudio&r1=1960&r2=1961&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/rtclock.c (original)
+++ branches/lennart/src/pulsecore/rtclock.c Sun Oct 28 00:05:20 2007
@@ -44,23 +44,20 @@
 
 struct timeval *pa_rtclock_get(struct timeval *tv) {
 #ifdef HAVE_CLOCK_GETTIME
-    static int no_monotonic = 0;
     struct timespec ts;
 
+#ifdef CLOCK_MONOTONIC
     /* No locking or atomic ops for no_monotonic here */
+    static pa_bool_t no_monotonic = FALSE;
 
-    if (!no_monotonic) {
-#ifdef CLOCK_MONOTONIC
-        if (clock_gettime(CLOCK_MONOTONIC, &ts) >= 0)
-            goto out;
+    if (!no_monotonic)
+        if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
+            no_monotonic = TRUE;
+
+    if (no_monotonic)
 #endif
+        pa_assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0);
 
-        no_monotonic = 1;
-    }
-
-    pa_assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0);
-
-out:
     pa_assert(tv);
 
     tv->tv_sec = ts.tv_sec;




More information about the pulseaudio-commits mailing list