[FFmpeg-devel] [PATCH 1/5] avutil/hwcontext_vulkan: Remove redundant resetting
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Fri Sep 15 02:44:09 EEST 2023
vulkan_free_internal() already resets the AVVkFrame.internal
pointer.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
1. I find it odd that the frame's internal is freed without
the frame itself being freed; vulkan_frame_free() expects
the internal to be present and seems to NPD if not.
(Actually, I was about to allocate AVVkFrames together
with their internal when I found out that their lifetime
was different.)
2. I have only tested that these patches compile, nothing more.
libavutil/hwcontext_vulkan.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 711a32a0ac..c783080567 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3065,7 +3065,6 @@ static int vulkan_transfer_data_from_cuda(AVHWFramesContext *hwfc,
fail:
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
vulkan_free_internal(dst_f);
- dst_f->internal = NULL;
av_buffer_unref(&dst->buf[0]);
return err;
}
@@ -3642,7 +3641,6 @@ static int vulkan_transfer_data_to_cuda(AVHWFramesContext *hwfc, AVFrame *dst,
fail:
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
vulkan_free_internal(dst_f);
- dst_f->internal = NULL;
av_buffer_unref(&dst->buf[0]);
return err;
}
--
2.34.1
More information about the ffmpeg-devel
mailing list