Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: webrtc/modules/audio_device/ios/audio_device_ios.mm

Issue 1237233003: Avoids error message about unknown selected data source for Port iPhone Microphone (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebased Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_device/ios/audio_device_ios.mm
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.mm b/webrtc/modules/audio_device/ios/audio_device_ios.mm
index cb15032544f4ed6aca753556f95e6a1b72c35f49..1d3c8e31d0e7b24d857c5f052c03a9954e93195a 100644
--- a/webrtc/modules/audio_device/ios/audio_device_ios.mm
+++ b/webrtc/modules/audio_device/ios/audio_device_ios.mm
@@ -28,18 +28,6 @@ namespace webrtc {
using ios::CheckAndLogError;
-#if !defined(NDEBUG)
-static void LogDeviceInfo() {
- LOG(LS_INFO) << "LogDeviceInfo";
- @autoreleasepool {
- LOG(LS_INFO) << " system name: " << ios::GetSystemName();
- LOG(LS_INFO) << " system version: " << ios::GetSystemVersion();
- LOG(LS_INFO) << " device type: " << ios::GetDeviceType();
- LOG(LS_INFO) << " device name: " << ios::GetDeviceName();
- }
-}
-#endif
-
static void ActivateAudioSession(AVAudioSession* session, bool activate) {
LOG(LS_INFO) << "ActivateAudioSession(" << activate << ")";
@autoreleasepool {
@@ -121,6 +109,18 @@ static void GetHardwareAudioParameters(AudioParameters* playout_parameters,
}
}
+#if !defined(NDEBUG)
+static void LogDeviceInfo() {
+ LOG(LS_INFO) << "LogDeviceInfo";
+ @autoreleasepool {
+ LOG(LS_INFO) << " system name: " << ios::GetSystemName();
+ LOG(LS_INFO) << " system version: " << ios::GetSystemVersion();
+ LOG(LS_INFO) << " device type: " << ios::GetDeviceType();
+ LOG(LS_INFO) << " device name: " << ios::GetDeviceName();
+ }
+}
+#endif
+
AudioDeviceIOS::AudioDeviceIOS()
: audio_device_buffer_(nullptr),
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
@@ -249,7 +249,7 @@ int32_t AudioDeviceIOS::InitPlayout() {
}
int32_t AudioDeviceIOS::InitRecording() {
- LOGI() << "InitPlayout";
+ LOGI() << "InitRecording";
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(_initialized);
DCHECK(!_recIsInitialized);
@@ -666,9 +666,6 @@ int32_t AudioDeviceIOS::InitPlayOrRecord() {
// files.
_audioInterruptionObserver = (__bridge_retained void*)observer;
- // Deactivate the audio session.
- ActivateAudioSession(session, false);
-
return 0;
}
@@ -698,6 +695,10 @@ int32_t AudioDeviceIOS::ShutdownPlayOrRecord() {
_auVoiceProcessing = nullptr;
}
+ // All I/O should be stopped or paused prior to deactivating the audio
+ // session, hence we deactivate as last action.
+ AVAudioSession* session = [AVAudioSession sharedInstance];
+ ActivateAudioSession(session, false);
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698