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

Unified Diff: webrtc/voice_engine/utility.cc

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 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
« no previous file with comments | « webrtc/voice_engine/utility.h ('k') | webrtc/voice_engine/voe_base_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/utility.cc
diff --git a/webrtc/voice_engine/utility.cc b/webrtc/voice_engine/utility.cc
index eb442ecb8f74c8ac607b1f74c85274a0566520b5..605e55369e3d4a31666e17bf69d3b04ccd054630 100644
--- a/webrtc/voice_engine/utility.cc
+++ b/webrtc/voice_engine/utility.cc
@@ -34,12 +34,12 @@ void RemixAndResample(const AudioFrame& src_frame,
void RemixAndResample(const int16_t* src_data,
size_t samples_per_channel,
- int num_channels,
+ size_t num_channels,
int sample_rate_hz,
PushResampler<int16_t>* resampler,
AudioFrame* dst_frame) {
const int16_t* audio_ptr = src_data;
- int audio_ptr_num_channels = num_channels;
+ size_t audio_ptr_num_channels = num_channels;
int16_t mono_audio[AudioFrame::kMaxDataSizeSamples];
// Downmix before resampling.
@@ -68,8 +68,7 @@ void RemixAndResample(const int16_t* src_data,
<< ", dst_frame->data_ = " << 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 (num_channels == 1 && dst_frame->num_channels_ == 2) {
@@ -81,9 +80,9 @@ void RemixAndResample(const int16_t* src_data,
}
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);
« no previous file with comments | « webrtc/voice_engine/utility.h ('k') | webrtc/voice_engine/voe_base_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698