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

Unified Diff: webrtc/tools/agc/agc_manager.cc

Issue 1227893002: Update audio code to use size_t more correctly, webrtc/ portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comment Created 5 years, 5 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/tools/agc/activity_metric.cc ('k') | webrtc/tools/agc/agc_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/agc/agc_manager.cc
diff --git a/webrtc/tools/agc/agc_manager.cc b/webrtc/tools/agc/agc_manager.cc
index 3d7f624c9fb9757f2cb33924be07165a8b7da7cb..36290f713cf2c6d11cf71f3de99fd10da6262aa5 100644
--- a/webrtc/tools/agc/agc_manager.cc
+++ b/webrtc/tools/agc/agc_manager.cc
@@ -66,7 +66,7 @@ class MediaCallback : public VoEMediaProcess {
protected:
virtual void Process(const int channel, const ProcessingTypes type,
- int16_t audio[], const int samples_per_channel,
+ int16_t audio[], const size_t samples_per_channel,
const int sample_rate_hz, const bool is_stereo) {
CriticalSectionScoped cs(crit_);
if (direct_->capture_muted()) {
@@ -81,7 +81,7 @@ class MediaCallback : public VoEMediaProcess {
int16_t mono[kMaxSamplesPerChannel];
int16_t* mono_ptr = audio;
if (is_stereo) {
- for (int n = 0; n < samples_per_channel; n++) {
+ for (size_t n = 0; n < samples_per_channel; n++) {
mono[n] = audio[n * 2];
}
mono_ptr = mono;
@@ -94,7 +94,7 @@ class MediaCallback : public VoEMediaProcess {
frame_.num_channels_ = is_stereo ? 2 : 1;
frame_.samples_per_channel_ = samples_per_channel;
frame_.sample_rate_hz_ = sample_rate_hz;
- const int length_samples = frame_.num_channels_ * samples_per_channel;
+ const size_t length_samples = frame_.num_channels_ * samples_per_channel;
memcpy(frame_.data_, audio, length_samples * sizeof(int16_t));
// Apply compression to the audio.
@@ -122,7 +122,7 @@ class PreprocCallback : public VoEMediaProcess {
protected:
virtual void Process(const int channel, const ProcessingTypes type,
- int16_t audio[], const int samples_per_channel,
+ int16_t audio[], const size_t samples_per_channel,
const int sample_rate_hz, const bool is_stereo) {
CriticalSectionScoped cs(crit_);
if (direct_->capture_muted()) {
« no previous file with comments | « webrtc/tools/agc/activity_metric.cc ('k') | webrtc/tools/agc/agc_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698