OLD | NEW |
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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 | 815 |
816 // Release the lock. | 816 // Release the lock. |
817 [session unlockForConfiguration]; | 817 [session unlockForConfiguration]; |
818 | 818 |
819 return true; | 819 return true; |
820 } | 820 } |
821 | 821 |
822 void AudioDeviceIOS::ShutdownPlayOrRecord() { | 822 void AudioDeviceIOS::ShutdownPlayOrRecord() { |
823 LOGI() << "ShutdownPlayOrRecord"; | 823 LOGI() << "ShutdownPlayOrRecord"; |
824 | 824 |
| 825 // Stop the audio unit to prevent any additional audio callbacks. |
| 826 audio_unit_->Stop(); |
| 827 |
825 // Close and delete the voice-processing I/O unit. | 828 // Close and delete the voice-processing I/O unit. |
826 audio_unit_.reset(); | 829 audio_unit_.reset(); |
827 | 830 |
828 // Remove audio session notification observers. | 831 // Remove audio session notification observers. |
829 RTCAudioSession* session = [RTCAudioSession sharedInstance]; | 832 RTCAudioSession* session = [RTCAudioSession sharedInstance]; |
830 [session removeDelegate:audio_session_observer_]; | 833 [session removeDelegate:audio_session_observer_]; |
831 | 834 |
832 // All I/O should be stopped or paused prior to deactivating the audio | 835 // All I/O should be stopped or paused prior to deactivating the audio |
833 // session, hence we deactivate as last action. | 836 // session, hence we deactivate as last action. |
834 [session lockForConfiguration]; | 837 [session lockForConfiguration]; |
835 UnconfigureAudioSession(); | 838 UnconfigureAudioSession(); |
836 [session endWebRTCSession:nil]; | 839 [session endWebRTCSession:nil]; |
837 [session unlockForConfiguration]; | 840 [session unlockForConfiguration]; |
838 } | 841 } |
839 | 842 |
840 } // namespace webrtc | 843 } // namespace webrtc |
OLD | NEW |