| Index: webrtc/voice_engine/utility.cc
|
| diff --git a/webrtc/voice_engine/utility.cc b/webrtc/voice_engine/utility.cc
|
| index 82ef076d41b01d70af7a60f55d4d22d2c2baaf41..f82a1ccf6c37b00188e3abeb0d1ebdc6c7d2bcdc 100644
|
| --- a/webrtc/voice_engine/utility.cc
|
| +++ b/webrtc/voice_engine/utility.cc
|
| @@ -27,7 +27,7 @@ void RemixAndResample(const AudioFrame& src_frame,
|
| PushResampler<int16_t>* resampler,
|
| AudioFrame* dst_frame) {
|
| const int16_t* audio_ptr = src_frame.data_;
|
| - int audio_ptr_num_channels = src_frame.num_channels_;
|
| + size_t audio_ptr_num_channels = src_frame.num_channels_;
|
| int16_t mono_audio[AudioFrame::kMaxDataSizeSamples];
|
|
|
| // Downmix before resampling.
|
| @@ -47,16 +47,15 @@ void RemixAndResample(const AudioFrame& src_frame,
|
| assert(false);
|
| }
|
|
|
| - const size_t src_length = src_frame.samples_per_channel_ *
|
| - audio_ptr_num_channels;
|
| + const size_t src_length =
|
| + src_frame.samples_per_channel_ * audio_ptr_num_channels;
|
| int out_length = resampler->Resample(audio_ptr, src_length, dst_frame->data_,
|
| AudioFrame::kMaxDataSizeSamples);
|
| if (out_length == -1) {
|
| LOG_FERR3(LS_ERROR, Resample, audio_ptr, src_length, dst_frame->data_);
|
| assert(false);
|
| }
|
| - dst_frame->samples_per_channel_ =
|
| - static_cast<size_t>(out_length / audio_ptr_num_channels);
|
| + dst_frame->samples_per_channel_ = out_length / audio_ptr_num_channels;
|
|
|
| // Upmix after resampling.
|
| if (src_frame.num_channels_ == 1 && dst_frame->num_channels_ == 2) {
|
| @@ -73,9 +72,9 @@ void RemixAndResample(const AudioFrame& src_frame,
|
|
|
| void DownConvertToCodecFormat(const int16_t* src_data,
|
| size_t samples_per_channel,
|
| - int num_channels,
|
| + size_t num_channels,
|
| int sample_rate_hz,
|
| - int codec_num_channels,
|
| + size_t codec_num_channels,
|
| int codec_rate_hz,
|
| int16_t* mono_buffer,
|
| PushResampler<int16_t>* resampler,
|
| @@ -116,15 +115,15 @@ void DownConvertToCodecFormat(const int16_t* src_data,
|
| assert(false);
|
| }
|
|
|
| - dst_af->samples_per_channel_ = static_cast<size_t>(out_length / num_channels);
|
| + dst_af->samples_per_channel_ = out_length / num_channels;
|
| dst_af->sample_rate_hz_ = destination_rate;
|
| dst_af->num_channels_ = num_channels;
|
| }
|
|
|
| void MixWithSat(int16_t target[],
|
| - int target_channel,
|
| + size_t target_channel,
|
| const int16_t source[],
|
| - int source_channel,
|
| + size_t source_channel,
|
| size_t source_len) {
|
| assert(target_channel == 1 || target_channel == 2);
|
| assert(source_channel == 1 || source_channel == 2);
|
|
|