From 5ff07c63b6b53274359d8ac54718c0206c903d08 Mon Sep 17 00:00:00 2001 From: tytan652 Date: Mon, 18 Jul 2022 18:55:49 +0200 Subject: [PATCH] mac-videotoolbox: Guard hardware_accelerated check behind macOS 10.14 --- plugins/mac-videotoolbox/encoder.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/mac-videotoolbox/encoder.c b/plugins/mac-videotoolbox/encoder.c index dc2064d35..15a2d2dc2 100644 --- a/plugins/mac-videotoolbox/encoder.c +++ b/plugins/mac-videotoolbox/encoder.c @@ -1082,12 +1082,15 @@ bool obs_module_load(void) VT_DICTSTR(kVTVideoEncoderList_EncoderID, id); VT_DICTSTR(kVTVideoEncoderList_DisplayName, disp_name); - CFBooleanRef hardware_ref = CFDictionaryGetValue( - encoder_dict, - kVTVideoEncoderList_IsHardwareAccelerated); bool hardware_accelerated = false; - if (hardware_ref) - hardware_accelerated = CFBooleanGetValue(hardware_ref); + if (__builtin_available(macOS 10.14, *)) { + CFBooleanRef hardware_ref = CFDictionaryGetValue( + encoder_dict, + kVTVideoEncoderList_IsHardwareAccelerated); + if (hardware_ref) + hardware_accelerated = + CFBooleanGetValue(hardware_ref); + } info.id = id; struct vt_encoder_type_data *type_data =