diff mbox series

[FFmpeg-devel,5/5] avutil/aarch64: Fallback to clock_gettime as timer on Android

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


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>

The inline asm doesn't work on Android.
 libavutil/aarch64/timer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Martin Storsjö June 4, 2024, 8:25 p.m. UTC | #1
On Tue, 4 Jun 2024, Zhao Zhili wrote:

> From: Zhao Zhili <zhilizhao@tencent.com>
> The inline asm doesn't work on Android.

Using pmccntr_el0 doen't work, no, but instead of falling back to 
clock_gettime, you may want to use cntvct_el0 instead of pmccntr_el0. IIRC 
that works on Android, at least it worked a number of years ago. It has 
less precision than pmccntr_el0, but maybe is better than clock_gettime?

I.e., use similar inline assembly as before, but with cntvct_el0 instead 
of pmccntr_el0.

// Martin
diff mbox series


diff --git a/libavutil/aarch64/timer.h b/libavutil/aarch64/timer.h
index fadc9568f8..13a58b48e4 100644
--- a/libavutil/aarch64/timer.h
+++ b/libavutil/aarch64/timer.h
@@ -24,7 +24,7 @@ 
 #include <stdint.h>
 #include "config.h"
-#if HAVE_INLINE_ASM && !defined(__APPLE__)
+#if HAVE_INLINE_ASM && !defined(__APPLE__) && !defined(__ANDROID__)
 #define AV_READ_TIME read_time