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

Unified Diff: webrtc/modules/audio_coding/neteq/buffer_level_filter.cc

Issue 1228843002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments 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/buffer_level_filter.cc
diff --git a/webrtc/modules/audio_coding/neteq/buffer_level_filter.cc b/webrtc/modules/audio_coding/neteq/buffer_level_filter.cc
index 93f9a55b2c37374c29c570bdd9da5d150ff679b8..905479178d212c623a5a1ab054c51871b1f37799 100644
--- a/webrtc/modules/audio_coding/neteq/buffer_level_filter.cc
+++ b/webrtc/modules/audio_coding/neteq/buffer_level_filter.cc
@@ -23,16 +23,16 @@ void BufferLevelFilter::Reset() {
level_factor_ = 253;
}
-void BufferLevelFilter::Update(int buffer_size_packets,
+void BufferLevelFilter::Update(size_t buffer_size_packets,
int time_stretched_samples,
- int packet_len_samples) {
+ size_t packet_len_samples) {
// Filter:
// |filtered_current_level_| = |level_factor_| * |filtered_current_level_| +
// (1 - |level_factor_|) * |buffer_size_packets|
// |level_factor_| and |filtered_current_level_| are in Q8.
// |buffer_size_packets| is in Q0.
filtered_current_level_ = ((level_factor_ * filtered_current_level_) >> 8) +
- ((256 - level_factor_) * buffer_size_packets);
+ ((256 - level_factor_) * static_cast<int>(buffer_size_packets));
// Account for time-scale operations (accelerate and pre-emptive expand).
if (time_stretched_samples && packet_len_samples > 0) {
@@ -42,7 +42,7 @@ void BufferLevelFilter::Update(int buffer_size_packets,
// Make sure that the filtered value remains non-negative.
filtered_current_level_ = std::max(0,
filtered_current_level_ -
- (time_stretched_samples << 8) / packet_len_samples);
+ (time_stretched_samples << 8) / static_cast<int>(packet_len_samples));
}
}
« no previous file with comments | « webrtc/modules/audio_coding/neteq/buffer_level_filter.h ('k') | webrtc/modules/audio_coding/neteq/comfort_noise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698