PR #22785 opened by t-boiko
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22785
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22785.patch

ff_vk_find_struct returns const void *, so storing it in const void 
*drm_create_pnext
fixes the initialization warning but then dpb_hwfc->create_pnext = 
drm_create_pnext
assigns const void * to void *, triggering the same warning at that line. The 
right
fix is a (void *) cast at the call site, same as done for buf_pnext.

Signed-off-by: Tymur Boiko <[email protected]>


>From 8c94ff57bb699e37303bebde449507383379d099 Mon Sep 17 00:00:00 2001
From: Tymur Boiko <[email protected]>
Date: Sat, 11 Apr 2026 01:36:06 +0200
Subject: [PATCH] libavcodec/vulkan_decode: fix -Wdiscarded-qualifiers warning
 in ff_vk_decode_init

ff_vk_find_struct returns const void *, so storing it in const void 
*drm_create_pnext
fixes the initialization warning but then dpb_hwfc->create_pnext = 
drm_create_pnext
assigns const void * to void *, triggering the same warning at that line. The 
right
fix is a (void *) cast at the call site, same as done for buf_pnext.

Signed-off-by: Tymur Boiko <[email protected]>
---
 libavcodec/vulkan_decode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index afca62b304..b4df8b971e 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -1399,8 +1399,8 @@ int ff_vk_decode_init(AVCodecContext *avctx)
         /* Reference (DPB) images use the same tiling and pNext chain as 
output.
          * If VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR is 0, 
the
          * driver does not support separate output and DPB with different 
layouts/tiling. */
-        void *drm_create_pnext = ff_vk_find_struct(ctx->s.hwfc->create_pnext,
-                                                   
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT);
+        void *drm_create_pnext = (void 
*)ff_vk_find_struct(ctx->s.hwfc->create_pnext,
+                                                           
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT);
         if (drm_create_pnext) {
             dpb_hwfc->create_pnext = drm_create_pnext;
             dpb_hwfc->tiling       = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
-- 
2.52.0

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

Reply via email to