summaryrefslogtreecommitdiff
path: root/libavutil/common.h
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2007-08-09 00:12:40 +0000
committerRoman Shaposhnik <roman@shaposhnik.org>2007-08-09 00:12:40 +0000
commitb6c748edbad9fb8a854f758553cfc8e5a1bbdb9c (patch)
tree20e97981aee016a93c11eeff87a7d4f1b48a83ba /libavutil/common.h
parent67c1b32f3d979989cfbde7e426bcf74b6fb9d0fb (diff)
* Making [START|STOP]_TIMER work on architectures that support gethrtime()
Originally committed as revision 9998 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/common.h')
-rw-r--r--libavutil/common.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index b9fd06d94b..7b23c3cccc 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -268,6 +268,7 @@ static inline int ff_get_fourcc(const char *s){
}
#if defined(ARCH_X86) || defined(ARCH_POWERPC) || defined(ARCH_BFIN)
+#define AV_READ_TIME read_time
#if defined(ARCH_X86_64)
static inline uint64_t read_time(void)
{
@@ -319,13 +320,17 @@ static inline uint64_t read_time(void)
return (((uint64_t)tbu)<<32) | (uint64_t)tbl;
}
#endif
+#elif defined(HAVE_GETHRTIME)
+#define AV_READ_TIME gethrtime
+#endif
+#ifdef AV_READ_TIME
#define START_TIMER \
uint64_t tend;\
-uint64_t tstart= read_time();\
+uint64_t tstart= AV_READ_TIME();\
#define STOP_TIMER(id) \
-tend= read_time();\
+tend= AV_READ_TIME();\
{\
static uint64_t tsum=0;\
static int tcount=0;\