Browse Source

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>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
c2923100f5
2 changed files with 15 additions and 3 deletions
  1. +4
    -0
      configure
  2. +11
    -3
      libavutil/timer.h

+ 4
- 0
configure View File

@@ -1606,6 +1606,8 @@ HAVE_LIST="
localtime_r localtime_r
loongson loongson
lzo1x_999_compress lzo1x_999_compress
mach_absolute_time
mach_mach_time_h
machine_ioctl_bt848_h machine_ioctl_bt848_h
machine_ioctl_meteor_h machine_ioctl_meteor_h
machine_rw_barrier machine_rw_barrier
@@ -4347,6 +4349,7 @@ check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
check_func gettimeofday check_func gettimeofday
check_func isatty check_func isatty
check_func localtime_r check_func localtime_r
check_func mach_absolute_time
check_func ${malloc_prefix}memalign && enable memalign check_func ${malloc_prefix}memalign && enable memalign
check_func mkstemp check_func mkstemp
check_func mmap check_func mmap
@@ -4389,6 +4392,7 @@ check_header dxva.h
check_header dxva2api.h -D_WIN32_WINNT=0x0600 check_header dxva2api.h -D_WIN32_WINNT=0x0600
check_header io.h check_header io.h
check_header libcrystalhd/libcrystalhd_if.h check_header libcrystalhd/libcrystalhd_if.h
check_header mach/mach_time.h
check_header malloc.h check_header malloc.h
check_header poll.h check_header poll.h
check_header sys/mman.h check_header sys/mman.h


+ 11
- 3
libavutil/timer.h View File

@@ -32,6 +32,10 @@


#include "config.h" #include "config.h"


#if HAVE_MACH_MACH_TIME_H
#include <mach/mach_time.h>
#endif

#include "log.h" #include "log.h"


#if ARCH_ARM #if ARCH_ARM
@@ -44,8 +48,12 @@
# include "x86/timer.h" # include "x86/timer.h"
#endif #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 #endif


#ifdef AV_READ_TIME #ifdef AV_READ_TIME
@@ -68,7 +76,7 @@
tskip_count++; \ tskip_count++; \
if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \ if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
av_log(NULL, AV_LOG_ERROR, \ 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); \ tsum * 10 / tcount, id, tcount, tskip_count); \
} \ } \
} }


Loading…
Cancel
Save