From 2ce4105a089e62657480f30a298351f4c84ca375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E7=94=B0=E5=96=9C=E9=99=BD=E5=BD=A6?= Date: Fri, 29 Nov 2019 03:27:55 -0800 Subject: [PATCH] Fix audio unit initialization condition in AudioDeviceIOS::UpdateAudioUnit --- sdk/objc/native/src/audio/audio_device_ios.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/objc/native/src/audio/audio_device_ios.mm b/sdk/objc/native/src/audio/audio_device_ios.mm index ff46ac84cf..7a9dd39954 100644 --- a/sdk/objc/native/src/audio/audio_device_ios.mm +++ b/sdk/objc/native/src/audio/audio_device_ios.mm @@ -816,7 +816,7 @@ static void LogDeviceInfo() { // be initialized on initialization. if (!audio_is_initialized_) return; - if (!audio_unit_ && !CreateAudioUnit()) { + if (can_play_or_record && !audio_unit_ && !CreateAudioUnit()) { RTCLog(@"Failed to create audio unit."); return; }