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

Unified Diff: webrtc/modules/audio_coding/neteq/post_decode_vad.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/post_decode_vad.cc
diff --git a/webrtc/modules/audio_coding/neteq/post_decode_vad.cc b/webrtc/modules/audio_coding/neteq/post_decode_vad.cc
index 07496730cd0fc315a41955b1a225b785aec2f3d6..714073ad10410d6aa3f252b7961568dc06dcbbcd 100644
--- a/webrtc/modules/audio_coding/neteq/post_decode_vad.cc
+++ b/webrtc/modules/audio_coding/neteq/post_decode_vad.cc
@@ -45,7 +45,7 @@ void PostDecodeVad::Init() {
}
}
-void PostDecodeVad::Update(int16_t* signal, int length,
+void PostDecodeVad::Update(int16_t* signal, size_t length,
AudioDecoder::SpeechType speech_type,
bool sid_frame,
int fs_hz) {
@@ -68,12 +68,13 @@ void PostDecodeVad::Update(int16_t* signal, int length,
}
if (length > 0 && running_) {
- int vad_sample_index = 0;
+ size_t vad_sample_index = 0;
active_speech_ = false;
// Loop through frame sizes 30, 20, and 10 ms.
for (int vad_frame_size_ms = 30; vad_frame_size_ms >= 10;
vad_frame_size_ms -= 10) {
- int vad_frame_size_samples = vad_frame_size_ms * fs_hz / 1000;
+ size_t vad_frame_size_samples =
+ static_cast<size_t>(vad_frame_size_ms * fs_hz / 1000);
while (length - vad_sample_index >= vad_frame_size_samples) {
int vad_return = WebRtcVad_Process(
vad_instance_, fs_hz, &signal[vad_sample_index],
« no previous file with comments | « webrtc/modules/audio_coding/neteq/post_decode_vad.h ('k') | webrtc/modules/audio_coding/neteq/preemptive_expand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698