]> code.delx.au - pulseaudio/commitdiff
Monotonic clock is optional so treat is as such.
authorPierre Ossman <ossman@cendio.se>
Mon, 10 Sep 2007 11:27:56 +0000 (11:27 +0000)
committerPierre Ossman <ossman@cendio.se>
Mon, 10 Sep 2007 11:27:56 +0000 (11:27 +0000)
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1780 fefdeb5f-60dc-0310-8127-8f9354f1896f

src/pulsecore/rtclock.c

index 02abde3ceb0bc26c02c9a1a60ad8d3790a7b6e45..7dd83b3fa1130f6a3fde3e2cf61f03db82b18ee8 100644 (file)
@@ -139,9 +139,11 @@ struct timespec *pa_rtclock_get(struct timespec *ts) {
     pa_assert(ts);
 
     if (!no_monotonic) {
+#ifdef CLOCK_MONOTONIC
         if (clock_gettime(CLOCK_MONOTONIC, ts) >= 0)
             return ts;
-        
+#endif        
+
         no_monotonic = 1;
     }
 
@@ -152,8 +154,10 @@ struct timespec *pa_rtclock_get(struct timespec *ts) {
 int pa_rtclock_hrtimer(void) {
     struct timespec ts;
     
+#ifdef CLOCK_MONOTONIC
     if (clock_getres(CLOCK_MONOTONIC, &ts) >= 0)
         return ts.tv_sec == 0 && ts.tv_nsec <= PA_HRTIMER_THRESHOLD_USEC*1000;
+#endif        
 
     pa_assert_se(clock_getres(CLOCK_REALTIME, &ts) == 0);
     return ts.tv_sec == 0 && ts.tv_nsec <= PA_HRTIMER_THRESHOLD_USEC*1000;