[FFmpeg-cvslog] avutil/hwcontext_videotoolbox: fix unused variable warning

Marvin Scholz git at videolan.org
Mon Jul 7 03:06:36 EEST 2025


ffmpeg | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Jun 27 02:30:09 2025 +0200| [d9eb63724ed5a65d36257185118986de0a5be46d] | committer: Marvin Scholz

avutil/hwcontext_videotoolbox: fix unused variable warning

Resolves an unused variable warning when targeting a recent appleOS
version.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d9eb63724ed5a65d36257185118986de0a5be46d
---

 libavutil/hwcontext_videotoolbox.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavutil/hwcontext_videotoolbox.c b/libavutil/hwcontext_videotoolbox.c
index 172683121f..102fa485e5 100644
--- a/libavutil/hwcontext_videotoolbox.c
+++ b/libavutil/hwcontext_videotoolbox.c
@@ -540,8 +540,6 @@ CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteri
 static CFDictionaryRef vt_cv_buffer_copy_attachments(CVBufferRef buffer,
                                                      CVAttachmentMode attachment_mode)
 {
-    CFDictionaryRef dict;
-
     // Check that our SDK is at least macOS 12 / iOS 15 / tvOS 15
     #if (TARGET_OS_OSX  && defined(__MAC_12_0)    && __MAC_OS_X_VERSION_MAX_ALLOWED  >= __MAC_12_0)     || \
         (TARGET_OS_IOS  && defined(__IPHONE_15_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_15_0)  || \
@@ -558,7 +556,7 @@ static CFDictionaryRef vt_cv_buffer_copy_attachments(CVBufferRef buffer,
         (TARGET_OS_IOS  && (!defined(__IPHONE_15_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_15_0))  || \
         (TARGET_OS_TV   && (!defined(__TVOS_15_0)   || __TV_OS_VERSION_MIN_REQUIRED     < __TVOS_15_0))
         // Fallback on SDKs or runtime versions < macOS 12 / iOS 15 / tvOS 15
-        dict = CVBufferGetAttachments(buffer, attachment_mode);
+        CFDictionaryRef dict = CVBufferGetAttachments(buffer, attachment_mode);
         return (dict) ? CFDictionaryCreateCopy(NULL, dict) : NULL;
     #else
         return NULL; // Impossible, just make the compiler happy



More information about the ffmpeg-cvslog mailing list