Skip to content

Commit

Permalink
Merge pull request #1639 from nextcloud/fix-audio-crash
Browse files Browse the repository at this point in the history
Fix race condition when retrieving current output
  • Loading branch information
Ivansss authored May 6, 2024
2 parents 1384276 + 4d3ed1b commit 24d3aa9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions NextcloudTalk/NCAudioController.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,10 @@ - (void)disableAudioSession
- (void)updateRouteInformation
{
AVAudioSession *audioSession = self.rtcAudioSession.session;
AVAudioSessionPortDescription *currentOutput = nil;
AVAudioSessionPortDescription *currentOutput = [audioSession.currentRoute.outputs firstObject];

self.numberOfAvailableInputs = audioSession.availableInputs.count;

if (audioSession.currentRoute.outputs.count > 0) {
currentOutput = audioSession.currentRoute.outputs[0];
}

if ([_rtcAudioSession mode] == AVAudioSessionModeVideoChat || [currentOutput.portType isEqualToString:AVAudioSessionPortBuiltInSpeaker]) {
self.isSpeakerActive = YES;
} else {
Expand Down

0 comments on commit 24d3aa9

Please sign in to comment.