From 2953f5d8569d8ea787925c868f21846e6b06e6e7 Mon Sep 17 00:00:00 2001 From: Bar Date: Sat, 12 Feb 2022 13:16:18 +0200 Subject: [PATCH] add another option to load (dlopen) avf --- src/rpcclient/rpcclient/darwin/darwin_media.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/rpcclient/rpcclient/darwin/darwin_media.py b/src/rpcclient/rpcclient/darwin/darwin_media.py index 5b81e7a1..e430ea08 100644 --- a/src/rpcclient/rpcclient/darwin/darwin_media.py +++ b/src/rpcclient/rpcclient/darwin/darwin_media.py @@ -84,9 +84,15 @@ def __init__(self, client): :param rpcclient.client.darwin_client.DarwinClient client: """ self._client = client - - if 0 == client.dlopen('/System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio', 2): - raise RpcClientException('failed to load AVFAudio') + self._load_av_foundation() + + def _load_av_foundation(self): + options = ['/System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation', + '/System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio'] + for option in options: + if self._client.dlopen(option, 2): + return + raise RpcClientException('failed to load AVFAudio') def set_audio_session(self): AVAudioSession = self._client.symbols.objc_getClass('AVAudioSession')