From 934d3f29ad499699b6d26501e4246fac0a07d7fb Mon Sep 17 00:00:00 2001 From: chenliming Date: Sat, 8 Oct 2016 14:34:36 +0800 Subject: [PATCH] changed to async --- LFLiveKit/capture/LFAudioCapture.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); });