aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/timer.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-09 14:30:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-09 14:30:24 +0100
commitc2923100f5a1199c46d5bc351fb3371956d1b90c (patch)
treecb41bb2dbab5fdd3795a3343e17f1ac231d62c0a /libavutil/timer.h
parentfa4f57399774b7c09c5978652b2eaea77f8851e1 (diff)
parentc708b5403346255ea5adc776645616cc7c61f078 (diff)
downloadffmpeg-c2923100f5a1199c46d5bc351fb3371956d1b90c.tar.gz
Merge commit 'c708b5403346255ea5adc776645616cc7c61f078'
* commit 'c708b5403346255ea5adc776645616cc7c61f078': timer: use mach_absolute_time as high resolution clock on darwin Conflicts: configure Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/timer.h')
-rw-r--r--libavutil/timer.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavutil/timer.h b/libavutil/timer.h
index 8de67f16d2..49e92fdfee 100644
--- a/libavutil/timer.h
+++ b/libavutil/timer.h
@@ -32,6 +32,10 @@
#include "config.h"
+#if HAVE_MACH_MACH_TIME_H
+#include <mach/mach_time.h>
+#endif
+
#include "log.h"
#if ARCH_ARM
@@ -44,8 +48,12 @@
# include "x86/timer.h"
#endif
-#if !defined(AV_READ_TIME) && HAVE_GETHRTIME
-# define AV_READ_TIME gethrtime
+#if !defined(AV_READ_TIME)
+# if HAVE_GETHRTIME
+# define AV_READ_TIME gethrtime
+# elif HAVE_MACH_ABSOLUTE_TIME
+# define AV_READ_TIME mach_absolute_time
+# endif
#endif
#ifdef AV_READ_TIME
@@ -68,7 +76,7 @@
tskip_count++; \
if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
av_log(NULL, AV_LOG_ERROR, \
- "%"PRIu64" decicycles in %s, %d runs, %d skips\n", \
+ "%"PRIu64" UNITS in %s, %d runs, %d skips\n", \
tsum * 10 / tcount, id, tcount, tskip_count); \
} \
}