Skip to content

Commit

Permalink
changed to async
Browse files Browse the repository at this point in the history
  • Loading branch information
chenliming committed Oct 8, 2016
1 parent 87b3244 commit 934d3f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions LFLiveKit/capture/LFAudioCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 934d3f2

Please sign in to comment.