summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/ffmpeg/libavutil/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/ffmpeg/libavutil/timer.h')
-rw-r--r--chromium/third_party/ffmpeg/libavutil/timer.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/chromium/third_party/ffmpeg/libavutil/timer.h b/chromium/third_party/ffmpeg/libavutil/timer.h
index 3e242f3463c..3fff77ff1c6 100644
--- a/chromium/third_party/ffmpeg/libavutil/timer.h
+++ b/chromium/third_party/ffmpeg/libavutil/timer.h
@@ -32,6 +32,12 @@
#include "config.h"
+#if HAVE_MACH_MACH_TIME_H
+#include <mach/mach_time.h>
+#endif
+
+#include "log.h"
+
#if ARCH_ARM
# include "arm/timer.h"
#elif ARCH_BFIN
@@ -42,8 +48,16 @@
# 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
+
+#ifndef FF_TIMER_UNITS
+# define FF_TIMER_UNITS "UNITS"
#endif
#ifdef AV_READ_TIME
@@ -66,7 +80,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" " FF_TIMER_UNITS " in %s, %d runs, %d skips\n", \
tsum * 10 / tcount, id, tcount, tskip_count); \
} \
}