From 51a4f34bb518a8262a3e5a65a1f29e68d8c548c2 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 7 Aug 2026 09:37:11 +0800 Subject: [PATCH] Codec (macOS): fixes a symbol not found error when running on 10.15 --- src/detection/codec/codec_apple.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/detection/codec/codec_apple.c b/src/detection/codec/codec_apple.c index 2cf2a48b2..e6cb3d382 100644 --- a/src/detection/codec/codec_apple.c +++ b/src/detection/codec/codec_apple.c @@ -3,6 +3,10 @@ #include #include "common/apple/cf_helpers.h" +#ifdef MAC_OS_VERSION_11_0 +[[clang::weak_import]] VT_EXPORT void VTRegisterSupplementalVideoDecoderIfAvailable(CMVideoCodecType codecType); +#endif + static const struct { CMVideoCodecType codec; FFCodecType type; @@ -70,9 +74,11 @@ static FFCodecType ffCodecDetectDecoders() { continue; } - if (__builtin_available(macOS 11.0, *)) { +#ifdef MAC_OS_VERSION_11_0 + if (VTRegisterSupplementalVideoDecoderIfAvailable) { VTRegisterSupplementalVideoDecoderIfAvailable(codec.codec); } +#endif bool supported = VTIsHardwareDecodeSupported(codec.codec); if (!supported) { continue;