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

Unified Diff: webrtc/common_audio/vad/webrtc_vad.c

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
« no previous file with comments | « webrtc/common_audio/vad/vad_unittest.cc ('k') | webrtc/common_audio/window_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/vad/webrtc_vad.c
diff --git a/webrtc/common_audio/vad/webrtc_vad.c b/webrtc/common_audio/vad/webrtc_vad.c
index 5af1b5bb0bcf0c34ca964e3452e0ccb61ec7d968..80c8f3c88d8eadcc55aee275ea8f23ae24bd6594 100644
--- a/webrtc/common_audio/vad/webrtc_vad.c
+++ b/webrtc/common_audio/vad/webrtc_vad.c
@@ -56,7 +56,7 @@ int WebRtcVad_set_mode(VadInst* handle, int mode) {
}
int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame,
- int frame_length) {
+ size_t frame_length) {
int vad = -1;
VadInstT* self = (VadInstT*) handle;
@@ -90,11 +90,11 @@ int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame,
return vad;
}
-int WebRtcVad_ValidRateAndFrameLength(int rate, int frame_length) {
+int WebRtcVad_ValidRateAndFrameLength(int rate, size_t frame_length) {
int return_value = -1;
size_t i;
int valid_length_ms;
- int valid_length;
+ size_t valid_length;
// We only allow 10, 20 or 30 ms frames. Loop through valid frame rates and
// see if we have a matching pair.
@@ -102,7 +102,7 @@ int WebRtcVad_ValidRateAndFrameLength(int rate, int frame_length) {
if (kValidRates[i] == rate) {
for (valid_length_ms = 10; valid_length_ms <= kMaxFrameLengthMs;
valid_length_ms += 10) {
- valid_length = (kValidRates[i] / 1000 * valid_length_ms);
+ valid_length = (size_t)(kValidRates[i] / 1000 * valid_length_ms);
if (frame_length == valid_length) {
return_value = 0;
break;
« no previous file with comments | « webrtc/common_audio/vad/vad_unittest.cc ('k') | webrtc/common_audio/window_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698