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

Unified Diff: webrtc/modules/audio_coding/main/test/opus_test.cc

Issue 1225133003: Update audio code to use size_t more correctly, (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/modules/audio_coding/main/test/initial_delay_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/main/test/opus_test.cc
diff --git a/webrtc/modules/audio_coding/main/test/opus_test.cc b/webrtc/modules/audio_coding/main/test/opus_test.cc
index c61d25ad19acd026b11bca7dd528f87a3a19d4be..79124aa7f381f1decdd1a5924acadb57e7265348 100644
--- a/webrtc/modules/audio_coding/main/test/opus_test.cc
+++ b/webrtc/modules/audio_coding/main/test/opus_test.cc
@@ -270,14 +270,14 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate,
if (loop_encode > 0) {
const int kMaxBytes = 1000; // Maximum number of bytes for one packet.
- int16_t bitstream_len_byte;
+ size_t bitstream_len_byte;
uint8_t bitstream[kMaxBytes];
for (int i = 0; i < loop_encode; i++) {
int bitstream_len_byte_int = WebRtcOpus_Encode(
(channels == 1) ? opus_mono_encoder_ : opus_stereo_encoder_,
&audio[read_samples], frame_length, kMaxBytes, bitstream);
ASSERT_GE(bitstream_len_byte_int, 0);
- bitstream_len_byte = static_cast<int16_t>(bitstream_len_byte_int);
+ bitstream_len_byte = static_cast<size_t>(bitstream_len_byte_int);
// Simulate packet loss by setting |packet_loss_| to "true" in
// |percent_loss| percent of the loops.
@@ -341,7 +341,8 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate,
audio_frame.samples_per_channel_ * audio_frame.num_channels_);
// Write stand-alone speech to file.
- out_file_standalone_.Write10MsData(out_audio, decoded_samples * channels);
+ out_file_standalone_.Write10MsData(
+ out_audio, static_cast<size_t>(decoded_samples) * channels);
if (audio_frame.timestamp_ > start_time_stamp) {
// Number of channels should be the same for both stand-alone and
« no previous file with comments | « webrtc/modules/audio_coding/main/test/initial_delay_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698