Skip to content

Commit 2eae5a8

Browse files
committed
Camera (macOS): try fixing segfault in macOS 10.15
1 parent 75da934 commit 2eae5a8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/detection/camera/camera_apple.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,16 @@
1616
#ifdef MAC_OS_X_VERSION_10_15
1717
FF_SUPPRESS_IO(); // #822
1818

19-
AVCaptureDeviceType deviceType;
19+
AVCaptureDeviceType deviceType = NULL;
2020

2121
#ifdef MAC_OS_VERSION_14_0
2222
if (@available(macOS 14.0, *))
2323
{
2424
deviceType = AVCaptureDeviceTypeExternal;
2525
}
26-
else
2726
#endif
28-
{
27+
if (deviceType == NULL)
2928
deviceType = AVCaptureDeviceTypeExternalUnknown;
30-
}
3129

3230
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType]
3331
mediaType:AVMediaTypeVideo

0 commit comments

Comments
 (0)