Skip to content

Commit

Permalink
ios: do not enter_call on audioreset
Browse files Browse the repository at this point in the history
  • Loading branch information
z-dule committed Oct 30, 2024
1 parent 4d0943f commit ba6b8b2
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/mediamgr/mm_platform_iosx.m
Original file line number Diff line number Diff line change
Expand Up @@ -817,13 +817,16 @@ int mm_platform_init(struct mm *mm, struct dict *sounds)
* re-init session
*/
info("mediamgr: AVAudioSessionMediaServices"
"WereResetNotification received\n");

mm_ios.route_override = false;
interrupt_action(true);
mediamgr_reset_sounds(mm_ios.mm);
interrupt_action(false);
mediamgr_audio_reset_mm(mm_ios.mm);
"WereResetNotification received incall=%d\n",
mm_ios.incall);

if (mm_ios.incall) {
mm_ios.route_override = false;
interrupt_action(true);
mediamgr_reset_sounds(mm_ios.mm);
interrupt_action(false);
mediamgr_audio_reset_mm(mm_ios.mm);
}
}];

[nc addObserverForName:UIApplicationDidBecomeActiveNotification
Expand Down Expand Up @@ -1106,8 +1109,8 @@ void mm_platform_enter_call(void)
AVAudioSession *sess = [AVAudioSession sharedInstance];
NSString *cat = [sess category];

info("mm_platform_ios: enter_call: incall=%s cat=$@\n",
mm_ios.incall ? "yes" : "no", cat);
info("mm_platform_ios: enter_call: incall=%s cat=%s\n",
mm_ios.incall ? "yes" : "no", [cat UTF8String]);

mm_ios.incall = true;

Expand Down

0 comments on commit ba6b8b2

Please sign in to comment.