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}
This commit is contained in:
peah
2016-04-09 16:06:52 -07:00
committed by Commit bot
parent b8a1454ffd
commit 423d236a54

View File

@ -94,7 +94,7 @@ bool is_multi_band(int sample_rate_hz) {
sample_rate_hz == AudioProcessing::kSampleRate48kHz; sample_rate_hz == AudioProcessing::kSampleRate48kHz;
} }
int ClosestNativeRate(int min_proc_rate) { int ClosestHigherNativeRate(int min_proc_rate) {
for (int rate : AudioProcessing::kNativeSampleRatesHz) { for (int rate : AudioProcessing::kNativeSampleRatesHz) {
if (rate >= min_proc_rate) { if (rate >= min_proc_rate) {
return rate; return rate;
@ -362,8 +362,8 @@ int AudioProcessingImpl::InitializeLocked(const ProcessingConfig& config) {
formats_.api_format = config; formats_.api_format = config;
capture_nonlocked_.fwd_proc_format = StreamConfig(ClosestNativeRate(std::min( capture_nonlocked_.fwd_proc_format = StreamConfig(ClosestHigherNativeRate(
formats_.api_format.input_stream().sample_rate_hz(), std::min(formats_.api_format.input_stream().sample_rate_hz(),
formats_.api_format.output_stream().sample_rate_hz()))); formats_.api_format.output_stream().sample_rate_hz())));
// We normally process the reverse stream at 16 kHz. Unless... // We normally process the reverse stream at 16 kHz. Unless...