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

Unified Diff: webrtc/tools/agc/test_utils.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/agc_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/tools/agc/test_utils.cc
diff --git a/webrtc/tools/agc/test_utils.cc b/webrtc/tools/agc/test_utils.cc
index 3a26cb9ac79a45fc39ac969f33f3ec50f40e9b98..81819c598e38aa7784a5eac20e7ab544506f007d 100644
--- a/webrtc/tools/agc/test_utils.cc
+++ b/webrtc/tools/agc/test_utils.cc
@@ -27,11 +27,12 @@ float Db2Linear(float db) {
}
void ApplyGainLinear(float gain, float last_gain, AudioFrame* frame) {
- const int frame_length = frame->samples_per_channel_ * frame->num_channels_;
+ const size_t frame_length =
+ frame->samples_per_channel_ * frame->num_channels_;
// Smooth the transition between gain levels across the frame.
float smoothed_gain = last_gain;
float gain_step = (gain - last_gain) / (frame_length - 1);
- for (int i = 0; i < frame_length; ++i) {
+ for (size_t i = 0; i < frame_length; ++i) {
smoothed_gain += gain_step;
float sample = std::floor(frame->data_[i] * smoothed_gain + 0.5);
sample = std::max(std::min(32767.0f, sample), -32768.0f);
« no previous file with comments | « webrtc/tools/agc/agc_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698