From 423d236a5421c58e3f2cf4dee014860187f822d8 Mon Sep 17 00:00:00 2001 From: peah Date: Sat, 9 Apr 2016 16:06:52 -0700 Subject: [PATCH] As the ClosestNativeRate method returns the closest native rate that is higher than the specified rate, and not the closest native rate the need for a name change has been raised. This CL addresses that. BUG=webrtc:5298 Review URL: https://codereview.webrtc.org/1863023002 Cr-Commit-Position: refs/heads/master@{#12302} --- webrtc/modules/audio_processing/audio_processing_impl.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc index 0f48fa5e18..163b33da31 100644 --- a/webrtc/modules/audio_processing/audio_processing_impl.cc +++ b/webrtc/modules/audio_processing/audio_processing_impl.cc @@ -94,7 +94,7 @@ bool is_multi_band(int sample_rate_hz) { sample_rate_hz == AudioProcessing::kSampleRate48kHz; } -int ClosestNativeRate(int min_proc_rate) { +int ClosestHigherNativeRate(int min_proc_rate) { for (int rate : AudioProcessing::kNativeSampleRatesHz) { if (rate >= min_proc_rate) { return rate; @@ -362,9 +362,9 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) { formats_.api_format = config; - capture_nonlocked_.fwd_proc_format = StreamConfig(ClosestNativeRate(std::min( - formats_.api_format.input_stream().sample_rate_hz(), - formats_.api_format.output_stream().sample_rate_hz()))); + capture_nonlocked_.fwd_proc_format = StreamConfig(ClosestHigherNativeRate( + std::min(formats_.api_format.input_stream().sample_rate_hz(), + formats_.api_format.output_stream().sample_rate_hz()))); // We normally process the reverse stream at 16 kHz. Unless... int rev_proc_rate = kSampleRate16kHz;