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

Unified Diff: webrtc/test/fake_audio_device.cc

Issue 1227893002: Update audio code to use size_t more correctly, webrtc/ portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comment 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/test/fake_audio_device.h ('k') | webrtc/tools/agc/activity_metric.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fake_audio_device.cc
diff --git a/webrtc/test/fake_audio_device.cc b/webrtc/test/fake_audio_device.cc
index bea125b14c085b8694b52d215c384f87169e74aa..4309aed5621eed731647796e69c14a66865023e2 100644
--- a/webrtc/test/fake_audio_device.cc
+++ b/webrtc/test/fake_audio_device.cc
@@ -99,7 +99,8 @@ void FakeAudioDevice::CaptureAudio() {
*input_stream_.get(), captured_audio_, kBufferSizeBytes);
if (bytes_read <= 0)
return;
- int num_samples = bytes_read / 2; // 2 bytes per sample.
+ // 2 bytes per sample.
+ size_t num_samples = static_cast<size_t>(bytes_read / 2);
uint32_t new_mic_level;
EXPECT_EQ(0,
audio_callback_->RecordedDataIsAvailable(captured_audio_,
@@ -112,14 +113,15 @@ void FakeAudioDevice::CaptureAudio() {
0,
false,
new_mic_level));
- uint32_t samples_needed = kFrequencyHz / 100;
+ size_t samples_needed = kFrequencyHz / 100;
int64_t now_ms = clock_->TimeInMilliseconds();
uint32_t time_since_last_playout_ms = now_ms - last_playout_ms_;
if (last_playout_ms_ > 0 && time_since_last_playout_ms > 0) {
- samples_needed = std::min(kFrequencyHz / time_since_last_playout_ms,
- kBufferSizeBytes / 2);
+ samples_needed = std::min(
+ static_cast<size_t>(kFrequencyHz / time_since_last_playout_ms),
+ kBufferSizeBytes / 2);
}
- uint32_t samples_out = 0;
+ size_t samples_out = 0;
int64_t elapsed_time_ms = -1;
int64_t ntp_time_ms = -1;
EXPECT_EQ(0,
« no previous file with comments | « webrtc/test/fake_audio_device.h ('k') | webrtc/tools/agc/activity_metric.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698