Codec (macOS): fixes a symbol not found error when running on 10.15

This commit is contained in:
Carter Li
2026-08-07 09:37:11 +08:00
parent 19ae272052
commit 9a940d73ba
+7 -1
View File
@@ -3,6 +3,10 @@
#include <VideoToolbox/VideoToolbox.h>
#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;