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}
diff --git a/webrtc/modules/audio_processing/audio_processing_impl.cc b/webrtc/modules/audio_processing/audio_processing_impl.cc
index 0f48fa5..163b33d 100644
--- a/webrtc/modules/audio_processing/audio_processing_impl.cc
+++ b/webrtc/modules/audio_processing/audio_processing_impl.cc
@@ -94,7 +94,7 @@
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 @@
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;