Try fixing a bug on iOS.

This commit is contained in:
David Reid
2018-11-13 13:44:22 +10:00
parent 026ae80fac
commit 351ac32d74
+9
View File
@@ -15568,6 +15568,15 @@ mal_result mal_context_init__coreaudio(mal_context* pContext)
{ {
mal_assert(pContext != NULL); mal_assert(pContext != NULL);
#if defined(MAL_APPLE_MOBILE)
@autoreleasepool {
AVAudioSession* pAudioSession = [AVAudioSession sharedInstance];
mal_assert(pAudioSession != NULL);
[pAudioSession setCategory: AVAudioSessionCategoryPlayAndRecord error:nil];
}
#endif
#if !defined(MAL_NO_RUNTIME_LINKING) && !defined(MAL_APPLE_MOBILE) #if !defined(MAL_NO_RUNTIME_LINKING) && !defined(MAL_APPLE_MOBILE)
pContext->coreaudio.hCoreFoundation = mal_dlopen("CoreFoundation.framework/CoreFoundation"); pContext->coreaudio.hCoreFoundation = mal_dlopen("CoreFoundation.framework/CoreFoundation");
if (pContext->coreaudio.hCoreFoundation == NULL) { if (pContext->coreaudio.hCoreFoundation == NULL) {