smani / rpms / ffmpeg

Forked from rpms/ffmpeg 5 months ago
Clone
Blob Blame History Raw
From 68ef9a29478fad450ec29ec14120afad3938e75b Mon Sep 17 00:00:00 2001
From: Sandro Mani <manisandro@gmail.com>
Date: Tue, 30 Jan 2024 09:16:13 +0100
Subject: [PATCH] Fix -Wint-conversion and -Wincompatible-pointer-types errors

---
 libavcodec/pcm-bluray.c           | 4 ++--
 libavcodec/pcm-dvd.c              | 2 +-
 libavcodec/vulkan_av1.c           | 2 +-
 libavcodec/vulkan_decode.c        | 6 +++---
 libavcodec/vulkan_video.c         | 2 +-
 libavfilter/vsrc_testsrc_vulkan.c | 4 ++--
 libavutil/hwcontext_vaapi.c       | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c
index f656095..56fa373 100644
--- a/libavcodec/pcm-bluray.c
+++ b/libavcodec/pcm-bluray.c
@@ -167,7 +167,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame,
             samples *= num_source_channels;
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
 #if HAVE_BIGENDIAN
-                bytestream2_get_buffer(&gb, dst16, buf_size);
+                bytestream2_get_buffer(&gb, (uint8_t*)dst16, buf_size);
 #else
                 do {
                     *dst16++ = bytestream2_get_be16u(&gb);
@@ -187,7 +187,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVFrame *frame,
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
                 do {
 #if HAVE_BIGENDIAN
-                    bytestream2_get_buffer(&gb, dst16, avctx->ch_layout.nb_channels * 2);
+                    bytestream2_get_buffer(&gb, (uint8_t*)dst16, avctx->ch_layout.nb_channels * 2);
                     dst16 += avctx->ch_layout.nb_channels;
 #else
                     channel = avctx->ch_layout.nb_channels;
diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c
index 419b2a1..319746c 100644
--- a/libavcodec/pcm-dvd.c
+++ b/libavcodec/pcm-dvd.c
@@ -157,7 +157,7 @@ static void *pcm_dvd_decode_samples(AVCodecContext *avctx, const uint8_t *src,
     switch (avctx->bits_per_coded_sample) {
     case 16: {
 #if HAVE_BIGENDIAN
-        bytestream2_get_buffer(&gb, dst16, blocks * s->block_size);
+        bytestream2_get_buffer(&gb, (uint8_t*)dst16, blocks * s->block_size);
         dst16 += blocks * s->block_size / 2;
 #else
         int samples = blocks * avctx->ch_layout.nb_channels;
diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c
index 4998bf7..9730e4b 100644
--- a/libavcodec/vulkan_av1.c
+++ b/libavcodec/vulkan_av1.c
@@ -180,7 +180,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf)
         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
         .pNext = &av1_params,
         .videoSession = ctx->common.session,
-        .videoSessionParametersTemplate = NULL,
+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
     };
 
     err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create);
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index a89d84f..fdbcbb4 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -188,9 +188,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic,
         return 0;
 
     vkpic->dpb_frame     = NULL;
-    vkpic->img_view_ref  = NULL;
-    vkpic->img_view_out  = NULL;
-    vkpic->img_view_dest = NULL;
+    vkpic->img_view_ref  = VK_NULL_HANDLE;
+    vkpic->img_view_out  = VK_NULL_HANDLE;
+    vkpic->img_view_dest = VK_NULL_HANDLE;
 
     vkpic->destroy_image_view = vk->DestroyImageView;
     vkpic->wait_semaphores = vk->WaitSemaphores;
diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index 236aa12..c5144bd 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -287,7 +287,7 @@ av_cold void ff_vk_video_common_uninit(FFVulkanContext *s,
     if (common->session) {
         vk->DestroyVideoSessionKHR(s->hwctx->act_dev, common->session,
                                    s->hwctx->alloc);
-        common->session = NULL;
+        common->session = VK_NULL_HANDLE;
     }
 
     if (common->nb_mem && common->mem)
diff --git a/libavfilter/vsrc_testsrc_vulkan.c b/libavfilter/vsrc_testsrc_vulkan.c
index 8761c21..1720bfa 100644
--- a/libavfilter/vsrc_testsrc_vulkan.c
+++ b/libavfilter/vsrc_testsrc_vulkan.c
@@ -231,7 +231,7 @@ static int testsrc_vulkan_activate(AVFilterContext *ctx)
                 return AVERROR(ENOMEM);
 
             err = ff_vk_filter_process_simple(&s->vkctx, &s->e, &s->pl, s->picref, NULL,
-                                              NULL, &s->opts, sizeof(s->opts));
+                                              VK_NULL_HANDLE, &s->opts, sizeof(s->opts));
             if (err < 0)
                 return err;
         }
@@ -250,7 +250,7 @@ static int testsrc_vulkan_activate(AVFilterContext *ctx)
     frame->sample_aspect_ratio = s->sar;
     if (!s->draw_once) {
         err = ff_vk_filter_process_simple(&s->vkctx, &s->e, &s->pl, frame, NULL,
-                                          NULL, &s->opts, sizeof(s->opts));
+                                          VK_NULL_HANDLE, &s->opts, sizeof(s->opts));
         if (err < 0) {
             av_frame_free(&frame);
             return err;
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 12bc951..d326ad6 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -1203,7 +1203,7 @@ static int vaapi_map_from_drm(AVHWFramesContext *src_fc, AVFrame *dst,
 
     if (!use_prime2 || vas != VA_STATUS_SUCCESS) {
         int k;
-        unsigned long buffer_handle;
+        size_t buffer_handle;
         VASurfaceAttribExternalBuffers buffer_desc;
         VASurfaceAttrib buffer_attrs[2] = {
             {
-- 
2.43.0