| 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 RTCLog(@"Handling playout sample rate change to: %f\n" | 573 RTCLog(@"Handling playout sample rate change to: %f\n" |
| 574 " Session sample rate: %f frames_per_buffer: %lu\n" | 574 " Session sample rate: %f frames_per_buffer: %lu\n" |
| 575 " ADM sample rate: %f frames_per_buffer: %lu", | 575 " ADM sample rate: %f frames_per_buffer: %lu", |
| 576 sample_rate, | 576 sample_rate, |
| 577 session_sample_rate, | 577 session_sample_rate, |
| 578 (unsigned long)session_frames_per_buffer, | 578 (unsigned long)session_frames_per_buffer, |
| 579 current_sample_rate, | 579 current_sample_rate, |
| 580 (unsigned long)current_frames_per_buffer); | 580 (unsigned long)current_frames_per_buffer); |
| 581 | 581 |
| 582 // Sample rate and buffer size are the same, no work to do. | 582 // Sample rate and buffer size are the same, no work to do. |
| 583 if (std::abs(current_sample_rate - session_sample_rate) <= DBL_EPSILON && | 583 if (std::abs((int)current_sample_rate - (int)session_sample_rate) <= DBL_EPSIL
ON && |
| 584 current_frames_per_buffer == session_frames_per_buffer) { | 584 current_frames_per_buffer == session_frames_per_buffer) { |
| 585 return; | 585 return; |
| 586 } | 586 } |
| 587 | 587 |
| 588 // We need to adjust our format and buffer sizes. | 588 // We need to adjust our format and buffer sizes. |
| 589 // The stream format is about to be changed and it requires that we first | 589 // The stream format is about to be changed and it requires that we first |
| 590 // stop and uninitialize the audio unit to deallocate its resources. | 590 // stop and uninitialize the audio unit to deallocate its resources. |
| 591 RTCLog(@"Stopping and uninitializing audio unit to adjust buffers."); | 591 RTCLog(@"Stopping and uninitializing audio unit to adjust buffers."); |
| 592 bool restart_audio_unit = false; | 592 bool restart_audio_unit = false; |
| 593 if (audio_unit_->GetState() == VoiceProcessingAudioUnit::kStarted) { | 593 if (audio_unit_->GetState() == VoiceProcessingAudioUnit::kStarted) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 | 869 |
| 870 // All I/O should be stopped or paused prior to deactivating the audio | 870 // All I/O should be stopped or paused prior to deactivating the audio |
| 871 // session, hence we deactivate as last action. | 871 // session, hence we deactivate as last action. |
| 872 [session lockForConfiguration]; | 872 [session lockForConfiguration]; |
| 873 UnconfigureAudioSession(); | 873 UnconfigureAudioSession(); |
| 874 [session endWebRTCSession:nil]; | 874 [session endWebRTCSession:nil]; |
| 875 [session unlockForConfiguration]; | 875 [session unlockForConfiguration]; |
| 876 } | 876 } |
| 877 | 877 |
| 878 } // namespace webrtc | 878 } // namespace webrtc |
| OLD | NEW |