diff mbox series

[FFmpeg-devel,4/5] avutil/timer: Add clock_gettime as a fallback of AV_READ_TIME

Message ID tencent_F2337595D749064EA285563314A84BF3E505@qq.com
State New
Headers show
Series [FFmpeg-devel,1/5] checkasm/sw_rgb: test rgb24 to yuv | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Zhao Zhili June 4, 2024, 1:55 p.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

---
 libavutil/timer.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/libavutil/timer.h b/libavutil/timer.h
index 2cd299eca3..74c4d84e69 100644
--- a/libavutil/timer.h
+++ b/libavutil/timer.h
@@ -46,6 +46,8 @@ 
 #include "macos_kperf.h"
 #elif HAVE_MACH_ABSOLUTE_TIME
 #include <mach/mach_time.h>
+#elif HAVE_CLOCK_GETTIME
+#include <time.h>
 #endif
 
 #include "common.h"
@@ -70,6 +72,9 @@ 
 #       define AV_READ_TIME gethrtime
 #   elif HAVE_MACH_ABSOLUTE_TIME
 #       define AV_READ_TIME mach_absolute_time
+#   elif HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC)
+#       include "libavutil/time.h"
+#       define AV_READ_TIME av_gettime_relative
 #   endif
 #endif