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

Unified Diff: webrtc/modules/audio_coding/neteq/merge.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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/expand.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/merge.cc
diff --git a/webrtc/modules/audio_coding/neteq/merge.cc b/webrtc/modules/audio_coding/neteq/merge.cc
index fa033cf63eaa5f4695c5bba76bed2b9ebb0155d5..23382acdd30f17a8b9bf9a2156b94c5772e6bdce 100644
--- a/webrtc/modules/audio_coding/neteq/merge.cc
+++ b/webrtc/modules/audio_coding/neteq/merge.cc
@@ -175,7 +175,7 @@ int Merge::GetExpandedSignal(int* old_length, int* expand_period) {
// This is the truncated length.
}
// This assert should always be true thanks to the if statement above.
- assert(210 * kMaxSampleRate / 8000 - *old_length >= 0);
+ assert(210 * kMaxSampleRate / 8000 >= *old_length);
AudioMultiVector expanded_temp(num_channels_);
expand_->Process(&expanded_temp);
@@ -342,7 +342,7 @@ int16_t Merge::CorrelateAndPeakSearch(int16_t expanded_max, int16_t input_max,
int start_index = timestamps_per_call_ +
static_cast<int>(expand_->overlap_length());
start_index = std::max(start_position, start_index);
- start_index = std::max(start_index - input_length, 0);
+ start_index = (input_length > start_index) ? 0 : (start_index - input_length);
// Downscale starting index to 4kHz domain. (fs_mult_ * 2 = fs_hz_ / 4000.)
int start_index_downsamp = start_index / (fs_mult_ * 2);
« no previous file with comments | « webrtc/modules/audio_coding/neteq/expand.cc ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698