Skip to content

Commit

Permalink
fix crash ios accept video call
Browse files Browse the repository at this point in the history
  • Loading branch information
Danmei Chen committed Mar 8, 2022
1 parent 8a5037b commit e2b8af6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audiofilters/msiounit.mm
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int apply_sound_card_to_audio_session(MSSndCard * newCard) {
NSError *err=nil;
if (newCard->device_type == MS_SND_CARD_DEVICE_TYPE_SPEAKER)
{
bool_t currentOutputIsSpeaker = (strcmp(currentRoute.outputs[0].portType.UTF8String, AVAudioSessionPortBuiltInSpeaker.UTF8String) == 0);
bool_t currentOutputIsSpeaker = (currentRoute.outputs.count > 0 && strcmp(currentRoute.outputs[0].portType.UTF8String, AVAudioSessionPortBuiltInSpeaker.UTF8String) == 0);
if (!currentOutputIsSpeaker) {
// If we're switching to speaker and the route output isn't the speaker already
ms_message("set_audio_unit_sound_card(): change AVAudioSession output audio to speaker");
Expand Down

0 comments on commit e2b8af6

Please sign in to comment.