From 3059378f7d62d6e4f8f344fcc534edea3ce9a295 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Thu, 22 Jun 2017 14:27:27 +0200 Subject: [PATCH] Always reset the audio session configuration after a call. After returning from the call the AVAudioSession was configured to use the receiver instead of the speaker for audio output. The configuration was only restored if the sound loop was previously playing, this change makes sure that the configuration is always reset so the sound can be played audibly after a call has been finished. Bug: webrtc:7792 Change-Id: Idabf6fadc8041b18722cb8f5e89e0c8c36b1b74d Reviewed-on: https://chromium-review.googlesource.com/544819 Reviewed-by: Magnus Jedvert Commit-Queue: Anders Carlsson Cr-Commit-Position: refs/heads/master@{#18754} --- webrtc/examples/BUILD.gn | 4 ---- webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn index e6138f10e6..de0e8c158c 100644 --- a/webrtc/examples/BUILD.gn +++ b/webrtc/examples/BUILD.gn @@ -271,10 +271,6 @@ if (is_ios || (is_mac && target_cpu != "x86")) { ":AppRTCMobile_ios_frameworks", ":apprtc_common", ":apprtc_signaling", - - # TODO(kthelgason): Remove this dep when audio_device has been - # moved to sdk. - "//webrtc/modules/audio_device:audio_device", ] } diff --git a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m index c57dace7a7..174514ff18 100644 --- a/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m +++ b/webrtc/examples/objc/AppRTCMobile/ios/ARDMainViewController.m @@ -235,9 +235,9 @@ static NSString *const loopbackLaunchProcessArgument = @"loopback"; } - (void)restartAudioPlayerIfNeeded { + [self configureAudioSession]; if (_mainView.isAudioLoopPlaying && !self.presentedViewController) { RTCLog(@"Starting audio loop due to WebRTC end."); - [self configureAudioSession]; [_audioPlayer play]; } }