From 334afc9838bf7ae7eacaf35b4423b3d42365178a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 2 Mar 2025 10:20:06 +0800 Subject: [PATCH] Camera (macOS): fix crashing on old macOS version Fix #1594 --- src/detection/camera/camera_apple.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/camera/camera_apple.m b/src/detection/camera/camera_apple.m index e80857744..5d6319560 100644 --- a/src/detection/camera/camera_apple.m +++ b/src/detection/camera/camera_apple.m @@ -19,7 +19,8 @@ const char* ffDetectCamera(FFlist* result) AVCaptureDeviceType deviceType = NULL; #ifdef MAC_OS_VERSION_14_0 - if (@available(macOS 14.0, *)) + // Strangely `@available(macOS 14.0, *)` doesn't work here (#1594) + if (@available(macOS 14.0, *) && &AVCaptureDeviceTypeExternal) { deviceType = AVCaptureDeviceTypeExternal; }