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

Side by Side Diff: webrtc/modules/audio_device/ios/audio_device_ios.mm

Issue 2872953002: iOS audio session isInterrupted flag does not get reset correctly: (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/external/webrtc into interrupt Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 LOGI() << "InitPlayOrRecord"; 790 LOGI() << "InitPlayOrRecord";
791 791
792 // There should be no audio unit at this point. 792 // There should be no audio unit at this point.
793 if (!CreateAudioUnit()) { 793 if (!CreateAudioUnit()) {
794 return false; 794 return false;
795 } 795 }
796 796
797 RTCAudioSession* session = [RTCAudioSession sharedInstance]; 797 RTCAudioSession* session = [RTCAudioSession sharedInstance];
798 // Subscribe to audio session events. 798 // Subscribe to audio session events.
799 [session pushDelegate:audio_session_observer_]; 799 [session pushDelegate:audio_session_observer_];
800 is_interrupted_ = session.isInterrupted ? true : false;
800 801
801 // Lock the session to make configuration changes. 802 // Lock the session to make configuration changes.
802 [session lockForConfiguration]; 803 [session lockForConfiguration];
803 NSError* error = nil; 804 NSError* error = nil;
804 if (![session beginWebRTCSession:&error]) { 805 if (![session beginWebRTCSession:&error]) {
805 [session unlockForConfiguration]; 806 [session unlockForConfiguration];
806 RTCLogError(@"Failed to begin WebRTC session: %@", 807 RTCLogError(@"Failed to begin WebRTC session: %@",
807 error.localizedDescription); 808 error.localizedDescription);
808 return false; 809 return false;
809 } 810 }
(...skipping 26 matching lines...) Expand all
836 837
837 // All I/O should be stopped or paused prior to deactivating the audio 838 // All I/O should be stopped or paused prior to deactivating the audio
838 // session, hence we deactivate as last action. 839 // session, hence we deactivate as last action.
839 [session lockForConfiguration]; 840 [session lockForConfiguration];
840 UnconfigureAudioSession(); 841 UnconfigureAudioSession();
841 [session endWebRTCSession:nil]; 842 [session endWebRTCSession:nil];
842 [session unlockForConfiguration]; 843 [session unlockForConfiguration];
843 } 844 }
844 845
845 } // namespace webrtc 846 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698