Skip to content

Instantly share code, notes, and snippets.

@TagPro-PreciousRoy
Created September 23, 2014 15:07
Show Gist options
  • Save TagPro-PreciousRoy/3dff081b99ea3c4ef90f to your computer and use it in GitHub Desktop.
Save TagPro-PreciousRoy/3dff081b99ea3c4ef90f to your computer and use it in GitHub Desktop.
Fix AbsoluteToNanoseconds
diff --git a/src/pulsecore/core-rtclock.c b/src/pulsecore/core-rtclock.c
index ee04554..6e9ba5f 100644
--- a/src/pulsecore/core-rtclock.c
+++ b/src/pulsecore/core-rtclock.c
@@ -67,19 +67,7 @@ pa_usec_t pa_rtclock_age(const struct timeval *tv) {
struct timeval *pa_rtclock_get(struct timeval *tv) {
-#if defined(OS_IS_DARWIN)
- uint64_t val, abs_time = mach_absolute_time();
- Nanoseconds nanos;
-
- nanos = AbsoluteToNanoseconds(*(AbsoluteTime *) &abs_time);
- val = *(uint64_t *) &nanos;
-
- tv->tv_sec = val / PA_NSEC_PER_SEC;
- tv->tv_usec = (val % PA_NSEC_PER_SEC) / PA_NSEC_PER_USEC;
-
- return tv;
-
-#elif defined(HAVE_CLOCK_GETTIME)
+#if defined(HAVE_CLOCK_GETTIME)
struct timespec ts;
#ifdef CLOCK_MONOTONIC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment