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

Unified Diff: webrtc/modules/audio_coding/neteq/decision_logic_normal.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/neteq/decision_logic_normal.cc
diff --git a/webrtc/modules/audio_coding/neteq/decision_logic_normal.cc b/webrtc/modules/audio_coding/neteq/decision_logic_normal.cc
index e985ee0aa394c274ffda9ffc5bcf21429ac676de..d3f6fa6dd45c43da7ad8dec4255f43c01f769b5d 100644
--- a/webrtc/modules/audio_coding/neteq/decision_logic_normal.cc
+++ b/webrtc/modules/audio_coding/neteq/decision_logic_normal.cc
@@ -27,7 +27,7 @@ namespace webrtc {
Operations DecisionLogicNormal::GetDecisionSpecialized(
const SyncBuffer& sync_buffer,
const Expand& expand,
- int decoder_frame_length,
+ size_t decoder_frame_length,
const RTPHeader* packet_header,
Modes prev_mode,
bool play_dtmf,
@@ -149,7 +149,7 @@ Operations DecisionLogicNormal::ExpectedPacketAvailable(Modes prev_mode,
Operations DecisionLogicNormal::FuturePacketAvailable(
const SyncBuffer& sync_buffer,
const Expand& expand,
- int decoder_frame_length,
+ size_t decoder_frame_length,
Modes prev_mode,
uint32_t target_timestamp,
uint32_t available_timestamp,
@@ -172,9 +172,9 @@ Operations DecisionLogicNormal::FuturePacketAvailable(
}
}
- const int samples_left = static_cast<int>(sync_buffer.FutureLength() -
- expand.overlap_length());
- const int cur_size_samples = samples_left +
+ const size_t samples_left =
+ sync_buffer.FutureLength() - expand.overlap_length();
+ const size_t cur_size_samples = samples_left +
packet_buffer_.NumPacketsInBuffer() * decoder_frame_length;
// If previous was comfort noise, then no merge is needed.
@@ -205,7 +205,8 @@ Operations DecisionLogicNormal::FuturePacketAvailable(
// fs_mult_ * 8 = fs / 1000.)
if (prev_mode == kModeExpand ||
(decoder_frame_length < output_size_samples_ &&
- cur_size_samples > kAllowMergeWithoutExpandMs * fs_mult_ * 8)) {
+ cur_size_samples >
+ static_cast<size_t>(kAllowMergeWithoutExpandMs * fs_mult_ * 8))) {
return kMerge;
} else if (play_dtmf) {
// Play DTMF instead of expand.
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decision_logic_normal.h ('k') | webrtc/modules/audio_coding/neteq/delay_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698