Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1124)

Unified Diff: webrtc/voice_engine/channel.cc

Issue 1338833002: Fix the maximum native sample rate in AudioProcessing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use minimum number of channels Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index c42ac0a9278c6aad1f3968ddecb9a32949792df1..e25df4f135fa9e8e6a903d88a3626c94c97d0cbe 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -3341,19 +3341,12 @@ void Channel::Demultiplex(const int16_t* audio_data,
CodecInst codec;
GetSendCodec(codec);
- if (!mono_recording_audio_.get()) {
- // Temporary space for DownConvertToCodecFormat.
- mono_recording_audio_.reset(new int16_t[kMaxMonoDataSizeSamples]);
- }
- DownConvertToCodecFormat(audio_data,
- number_of_frames,
- number_of_channels,
- sample_rate,
- codec.channels,
- codec.plfreq,
- mono_recording_audio_.get(),
- &input_resampler_,
- &_audioFrame);
+ // Never upsample the capture signal here. This should be done at the
Andrew MacDonald 2015/09/23 17:31:47 add "or upmix"
aluebs-webrtc 2015/09/23 19:48:54 Good point. Done.
+ // end of the send chain.
+ _audioFrame.sample_rate_hz_ = std::min(codec.plfreq, sample_rate);
+ _audioFrame.num_channels_ = std::min(number_of_channels, codec.channels);
+ RemixAndResample(audio_data, number_of_frames, number_of_channels,
+ sample_rate, &input_resampler_, &_audioFrame);
}
uint32_t

Powered by Google App Engine
This is Rietveld 408576698