From e1766011ca68582324802aa3e9e820c3ec899aae Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 10 Sep 2007 11:27:56 +0000 Subject: Monotonic clock is optional so treat is as such. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1780 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/rtclock.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pulsecore/rtclock.c b/src/pulsecore/rtclock.c index 02abde3c..7dd83b3f 100644 --- a/src/pulsecore/rtclock.c +++ b/src/pulsecore/rtclock.c @@ -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; -- cgit