PR #22478 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22478
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22478.patch

Fixes compilation errors on newer Clang/GCC that errors out on
incompatible pointers.

error: incompatible pointer types passing 'unsigned long long *' to
parameter of type 'amf_uint64 *' (aka 'unsigned long *')
[-Wincompatible-pointer-types]

Signed-off-by: Kacper Michajłow <[email protected]>


From 43f0df14d16d4f4791227ba028786f54daa51f1c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Wed, 11 Mar 2026 15:40:59 +0100
Subject: [PATCH] hwcontext_amf: fix version variable type and remove cast
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes compilation errors on newer Clang/GCC that errors out on
incompatible pointers.

error: incompatible pointer types passing 'unsigned long long *' to
parameter of type 'amf_uint64 *' (aka 'unsigned long *')
[-Wincompatible-pointer-types]

Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavutil/hwcontext_amf.c | 2 +-
 libavutil/hwcontext_amf.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext_amf.c b/libavutil/hwcontext_amf.c
index 4ccbe36c98..5df8dd949c 100644
--- a/libavutil/hwcontext_amf.c
+++ b/libavutil/hwcontext_amf.c
@@ -615,7 +615,7 @@ static int amf_load_library(AVAMFDeviceContext* amf_ctx,  
void* avcl)
     version_fun = (AMFQueryVersion_Fn)dlsym(amf_ctx->library, 
AMF_QUERY_VERSION_FUNCTION_NAME);
     AMF_RETURN_IF_FALSE(avcl, version_fun != NULL, AVERROR_UNKNOWN, "DLL %s 
failed to find function %s\n", AMF_DLL_NAMEA, AMF_QUERY_VERSION_FUNCTION_NAME);
 
-    res = version_fun((unsigned long long*)&amf_ctx->version);
+    res = version_fun(&amf_ctx->version);
     AMF_RETURN_IF_FALSE(avcl, res == AMF_OK, AVERROR_UNKNOWN, "%s failed with 
error %d\n", AMF_QUERY_VERSION_FUNCTION_NAME, res);
     res = init_fun(AMF_FULL_VERSION, &amf_ctx->factory);
     AMF_RETURN_IF_FALSE(avcl, res == AMF_OK, AVERROR_UNKNOWN, "%s failed with 
error %d\n", AMF_INIT_FUNCTION_NAME, res);
diff --git a/libavutil/hwcontext_amf.h b/libavutil/hwcontext_amf.h
index 918eec97b8..40c844fb29 100644
--- a/libavutil/hwcontext_amf.h
+++ b/libavutil/hwcontext_amf.h
@@ -37,7 +37,7 @@ typedef struct AVAMFDeviceContext {
     AMFFactory         *factory;
     void               *trace_writer;
 
-    int64_t             version; ///< version of AMF runtime
+    amf_uint64          version; ///< version of AMF runtime
     AMFContext         *context;
     AMF_MEMORY_TYPE     memory_type;
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to