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

Unified Diff: webrtc/modules/audio_coding/main/acm2/acm_resampler.cc

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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/modules/audio_coding/main/acm2/acm_resampler.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc b/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc
index 97d87b1b3a4b357939d27b089f94c70598728a26..2650725331b94e5db5e110836704d11082657ec6 100644
--- a/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc
+++ b/webrtc/modules/audio_coding/main/acm2/acm_resampler.cc
@@ -29,9 +29,9 @@ int ACMResampler::Resample10Msec(const int16_t* in_audio,
int in_freq_hz,
int out_freq_hz,
int num_audio_channels,
- int out_capacity_samples,
+ size_t out_capacity_samples,
int16_t* out_audio) {
- int in_length = in_freq_hz * num_audio_channels / 100;
+ size_t in_length = static_cast<size_t>(in_freq_hz * num_audio_channels / 100);
int out_length = out_freq_hz * num_audio_channels / 100;
if (in_freq_hz == out_freq_hz) {
if (out_capacity_samples < in_length) {
@@ -39,7 +39,7 @@ int ACMResampler::Resample10Msec(const int16_t* in_audio,
return -1;
}
memcpy(out_audio, in_audio, in_length * sizeof(int16_t));
- return in_length / num_audio_channels;
+ return static_cast<int>(in_length / num_audio_channels);
}
if (resampler_.InitializeIfNeeded(in_freq_hz, out_freq_hz,
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_resampler.h ('k') | webrtc/modules/audio_coding/main/acm2/acm_send_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698