From 9b80030f00208a884ab1d6f522824da4caa23208 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 30 Dec 2018 14:48:14 +1000 Subject: [PATCH] Core Audio: Exclusive mode is not supported right now. --- mini_al.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mini_al.h b/mini_al.h index 7953ee70..7c7b2e30 100644 --- a/mini_al.h +++ b/mini_al.h @@ -14712,8 +14712,12 @@ mal_result mal_context_enumerate_devices__coreaudio(mal_context* pContext, mal_e mal_result mal_context_get_device_info__coreaudio(mal_context* pContext, mal_device_type deviceType, const mal_device_id* pDeviceID, mal_share_mode shareMode, mal_device_info* pDeviceInfo) { mal_assert(pContext != NULL); - (void)shareMode; (void)pDeviceInfo; + + /* No exclusive mode with the Core Audio backend for now. */ + if (shareMode == mal_share_mode_exclusive) { + return MAL_SHARE_MODE_NOT_SUPPORTED; + } #if defined(MAL_APPLE_DESKTOP) // Desktop @@ -15564,7 +15568,11 @@ mal_result mal_device_init__coreaudio(mal_context* pContext, mal_device_type dev mal_assert(pContext != NULL); mal_assert(pConfig != NULL); mal_assert(pDevice != NULL); - mal_assert(deviceType == mal_device_type_playback || deviceType == mal_device_type_capture); + + /* No exclusive mode with the Core Audio backend for now. */ + if (pConfig->shareMode == mal_share_mode_exclusive) { + return MAL_SHARE_MODE_NOT_SUPPORTED; + } mal_device_init_internal_data__coreaudio data; data.formatIn = pDevice->format;