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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 const size_t current_frames_per_buffer = | 530 const size_t current_frames_per_buffer = |
531 playout_parameters_.frames_per_buffer(); | 531 playout_parameters_.frames_per_buffer(); |
532 RTCLog(@"Handling playout sample rate change to: %f\n" | 532 RTCLog(@"Handling playout sample rate change to: %f\n" |
533 " Session sample rate: %f frames_per_buffer: %lu\n" | 533 " Session sample rate: %f frames_per_buffer: %lu\n" |
534 " ADM sample rate: %f frames_per_buffer: %lu", | 534 " ADM sample rate: %f frames_per_buffer: %lu", |
535 sample_rate, | 535 sample_rate, |
536 session_sample_rate, (unsigned long)session_frames_per_buffer, | 536 session_sample_rate, (unsigned long)session_frames_per_buffer, |
537 current_sample_rate, (unsigned long)current_frames_per_buffer);; | 537 current_sample_rate, (unsigned long)current_frames_per_buffer);; |
538 | 538 |
539 // Sample rate and buffer size are the same, no work to do. | 539 // Sample rate and buffer size are the same, no work to do. |
540 if (abs(current_sample_rate - session_sample_rate) <= DBL_EPSILON && | 540 if (std::abs(current_sample_rate - session_sample_rate) <= DBL_EPSILON && |
541 current_frames_per_buffer == session_frames_per_buffer) { | 541 current_frames_per_buffer == session_frames_per_buffer) { |
542 return; | 542 return; |
543 } | 543 } |
544 | 544 |
545 // We need to adjust our format and buffer sizes. | 545 // We need to adjust our format and buffer sizes. |
546 // The stream format is about to be changed and it requires that we first | 546 // The stream format is about to be changed and it requires that we first |
547 // stop and uninitialize the audio unit to deallocate its resources. | 547 // stop and uninitialize the audio unit to deallocate its resources. |
548 RTCLog(@"Stopping and uninitializing audio unit to adjust buffers."); | 548 RTCLog(@"Stopping and uninitializing audio unit to adjust buffers."); |
549 bool restart_audio_unit = false; | 549 bool restart_audio_unit = false; |
550 if (audio_unit_->GetState() == VoiceProcessingAudioUnit::kStarted) { | 550 if (audio_unit_->GetState() == VoiceProcessingAudioUnit::kStarted) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 | 834 |
835 // 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 |
836 // session, hence we deactivate as last action. | 836 // session, hence we deactivate as last action. |
837 [session lockForConfiguration]; | 837 [session lockForConfiguration]; |
838 UnconfigureAudioSession(); | 838 UnconfigureAudioSession(); |
839 [session endWebRTCSession:nil]; | 839 [session endWebRTCSession:nil]; |
840 [session unlockForConfiguration]; | 840 [session unlockForConfiguration]; |
841 } | 841 } |
842 | 842 |
843 } // namespace webrtc | 843 } // namespace webrtc |
OLD | NEW |