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

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

Issue 1174813003: Prepare to convert various types to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments + resync Created 5 years, 6 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/audio_coding_module_impl.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
index 0da2eb5c068830c521c168c5d774eb40fe94461a..b659649096e8c583400698e16a5b1723d3b4c4dc 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc
@@ -89,9 +89,11 @@ int UpMix(const AudioFrame& frame, int length_out_buff, int16_t* out_buff) {
if (length_out_buff < frame.samples_per_channel_) {
return -1;
}
- for (int n = frame.samples_per_channel_ - 1; n >= 0; --n) {
- out_buff[2 * n + 1] = frame.data_[n];
- out_buff[2 * n] = frame.data_[n];
+ for (int n = frame.samples_per_channel_; n > 0; --n) {
+ int i = n - 1;
+ int16_t sample = frame.data_[i];
+ out_buff[2 * i + 1] = sample;
+ out_buff[2 * i] = sample;
}
return 0;
}
« no previous file with comments | « webrtc/modules/audio_coding/codecs/opus/opus_unittest.cc ('k') | webrtc/modules/audio_coding/neteq/expand.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698