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

Unified Diff: media/cast/receiver/audio_decoder_unittest.cc

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 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 | « no previous file | media/cast/test/utility/audio_utility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/receiver/audio_decoder_unittest.cc
diff --git a/media/cast/receiver/audio_decoder_unittest.cc b/media/cast/receiver/audio_decoder_unittest.cc
index f31aa983eecbcccaa70f98a6c581ca381c996e3b..f2cc50f38df2e0753d9a97fe547475ab6bc3d943 100644
--- a/media/cast/receiver/audio_decoder_unittest.cc
+++ b/media/cast/receiver/audio_decoder_unittest.cc
@@ -58,7 +58,7 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> {
TestAudioBusFactory::kMiddleANoteFreq,
0.5f));
last_frame_id_ = FrameId::first();
- seen_a_decoded_frame_ = false;
+ decoded_frames_seen_ = 0;
if (GetParam().codec == CODEC_AUDIO_OPUS) {
opus_encoder_memory_.reset(
@@ -159,12 +159,12 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> {
EXPECT_EQ(should_be_continuous, is_continuous);
// Does the audio data seem to be intact? For Opus, we have to ignore the
- // first frame seen at the start (and immediately after dropped packet
+ // first two frames seen at the start (and immediately after dropped packet
// recovery) because it introduces a tiny, significant delay.
bool examine_signal = true;
if (GetParam().codec == CODEC_AUDIO_OPUS) {
- examine_signal = seen_a_decoded_frame_ && should_be_continuous;
- seen_a_decoded_frame_ = true;
+ ++decoded_frames_seen_;
+ examine_signal = (decoded_frames_seen_ > 2) && should_be_continuous;
}
if (examine_signal) {
for (int ch = 0; ch < audio_bus->channels(); ++ch) {
@@ -187,7 +187,7 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> {
std::unique_ptr<AudioDecoder> audio_decoder_;
std::unique_ptr<TestAudioBusFactory> audio_bus_factory_;
FrameId last_frame_id_;
- bool seen_a_decoded_frame_;
+ int decoded_frames_seen_;
std::unique_ptr<uint8_t[]> opus_encoder_memory_;
base::Lock lock_;
« no previous file with comments | « no previous file | media/cast/test/utility/audio_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698