diff --git a/LFLiveKit/capture/LFAudioCapture.m b/LFLiveKit/capture/LFAudioCapture.m index ef9fbb59..7eb5acf0 100755 --- a/LFLiveKit/capture/LFAudioCapture.m +++ b/LFLiveKit/capture/LFAudioCapture.m @@ -98,7 +98,7 @@ - (instancetype)initWithAudioConfiguration:(LFLiveAudioConfiguration *)configura - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - dispatch_sync(self.taskQueue, ^{ + dispatch_async(self.taskQueue, ^{ if (self.componetInstance) { self.isRunning = NO; AudioOutputUnitStop(self.componetInstance); @@ -121,7 +121,7 @@ - (void)setRunning:(BOOL)running { AudioOutputUnitStart(self.componetInstance); }); } else { - dispatch_sync(self.taskQueue, ^{ + dispatch_async(self.taskQueue, ^{ self.isRunning = NO; NSLog(@"MicrophoneSource: stopRunning"); AudioOutputUnitStop(self.componetInstance); @@ -182,7 +182,7 @@ - (void)handleInterruption:(NSNotification *)notification { reason = [[[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey] integerValue]; if (reason == AVAudioSessionInterruptionTypeBegan) { if (self.isRunning) { - dispatch_sync(self.taskQueue, ^{ + dispatch_async(self.taskQueue, ^{ NSLog(@"MicrophoneSource: stopRunning"); AudioOutputUnitStop(self.componetInstance); });