mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
juce_video: Prevent a runtime crash when LTO is enabled on macOS versions < 14.0
This commit is contained in:
parent
8eb45ebdf0
commit
84750f2f2a
1 changed files with 3 additions and 11 deletions
|
|
@ -146,17 +146,9 @@ struct CameraDevice::Pimpl
|
||||||
#if JUCE_USE_NEW_CAMERA_API
|
#if JUCE_USE_NEW_CAMERA_API
|
||||||
if (@available (macOS 10.15, *))
|
if (@available (macOS 10.15, *))
|
||||||
{
|
{
|
||||||
const auto deviceType = [&]
|
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations")
|
||||||
{
|
const auto deviceType = AVCaptureDeviceTypeExternalUnknown;
|
||||||
#if defined (MAC_OS_VERSION_14_0) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_14_0
|
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
||||||
if (@available (macOS 14.0, *))
|
|
||||||
return AVCaptureDeviceTypeExternal;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations", "-Wunguarded-availability-new")
|
|
||||||
return AVCaptureDeviceTypeExternalUnknown;
|
|
||||||
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
|
|
||||||
}();
|
|
||||||
|
|
||||||
auto* discovery = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes: @[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType]
|
auto* discovery = [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes: @[AVCaptureDeviceTypeBuiltInWideAngleCamera, deviceType]
|
||||||
mediaType: AVMediaTypeVideo
|
mediaType: AVMediaTypeVideo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue