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

Unified Diff: webrtc/modules/audio_coding/codecs/opus/opus_fec_test.cc

Issue 1225173002: 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/codecs/opus/opus_fec_test.cc
diff --git a/webrtc/modules/audio_coding/codecs/opus/opus_fec_test.cc b/webrtc/modules/audio_coding/codecs/opus/opus_fec_test.cc
index f0ef70a3ba46be4dec24fbef2641d1d9e12d5b21..c86fab766066e11ae5c18d199d98299c86e452f5 100644
--- a/webrtc/modules/audio_coding/codecs/opus/opus_fec_test.cc
+++ b/webrtc/modules/audio_coding/codecs/opus/opus_fec_test.cc
@@ -45,15 +45,15 @@ class OpusFecTest : public TestWithParam<coding_param> {
int block_duration_ms_;
int sampling_khz_;
- int block_length_sample_;
+ size_t block_length_sample_;
int channels_;
int bit_rate_;
size_t data_pointer_;
size_t loop_length_samples_;
- int max_bytes_;
- int encoded_bytes_;
+ size_t max_bytes_;
+ size_t encoded_bytes_;
WebRtcOpusEncInst* opus_encoder_;
WebRtcOpusDecInst* opus_decoder_;
@@ -122,7 +122,8 @@ void OpusFecTest::TearDown() {
OpusFecTest::OpusFecTest()
: block_duration_ms_(kOpusBlockDurationMs),
sampling_khz_(kOpusSamplingKhz),
- block_length_sample_(block_duration_ms_ * sampling_khz_),
+ block_length_sample_(
+ static_cast<size_t>(block_duration_ms_ * sampling_khz_)),
data_pointer_(0),
max_bytes_(0),
encoded_bytes_(0),
@@ -137,7 +138,7 @@ void OpusFecTest::EncodeABlock() {
max_bytes_, &bit_stream_[0]);
EXPECT_GT(value, 0);
- encoded_bytes_ = value;
+ encoded_bytes_ = static_cast<size_t>(value);
}
void OpusFecTest::DecodeABlock(bool lost_previous, bool lost_current) {
@@ -154,14 +155,14 @@ void OpusFecTest::DecodeABlock(bool lost_previous, bool lost_current) {
} else {
value_1 = WebRtcOpus_DecodePlc(opus_decoder_, &out_data_[0], 1);
}
- EXPECT_EQ(block_length_sample_, value_1);
+ EXPECT_EQ(static_cast<int>(block_length_sample_), value_1);
}
if (!lost_current) {
// Decode current frame.
value_2 = WebRtcOpus_Decode(opus_decoder_, &bit_stream_[0], encoded_bytes_,
&out_data_[value_1 * channels_], &audio_type);
- EXPECT_EQ(block_length_sample_, value_2);
+ EXPECT_EQ(static_cast<int>(block_length_sample_), value_2);
}
}

Powered by Google App Engine
This is Rietveld 408576698