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

Unified Diff: webrtc/modules/audio_processing/vad/voice_activity_detector.cc

Issue 1228803003: 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, 5 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_processing/vad/voice_activity_detector.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_processing/vad/voice_activity_detector.cc
diff --git a/webrtc/modules/audio_processing/vad/voice_activity_detector.cc b/webrtc/modules/audio_processing/vad/voice_activity_detector.cc
index 05995ed186bb54f31a74c189d149273d5b16c22b..c5c849847b6eaeca740d268045d3470b840bd8c0 100644
--- a/webrtc/modules/audio_processing/vad/voice_activity_detector.cc
+++ b/webrtc/modules/audio_processing/vad/voice_activity_detector.cc
@@ -17,7 +17,7 @@
namespace webrtc {
namespace {
-const int kMaxLength = 320;
+const size_t kMaxLength = 320;
const int kNumChannels = 1;
const double kDefaultVoiceValue = 1.0;
@@ -35,9 +35,9 @@ VoiceActivityDetector::VoiceActivityDetector()
// |chunkwise_voice_probabilities_| and |chunkwise_rms_| when there is new data.
// Otherwise it clears them.
void VoiceActivityDetector::ProcessChunk(const int16_t* audio,
- int length,
+ size_t length,
int sample_rate_hz) {
- DCHECK_EQ(length, sample_rate_hz / 100);
+ DCHECK_EQ(static_cast<int>(length), sample_rate_hz / 100);
DCHECK_LE(length, kMaxLength);
// Resample to the required rate.
const int16_t* resampled_ptr = audio;
« no previous file with comments | « webrtc/modules/audio_processing/vad/voice_activity_detector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698