diff --git a/webrtc/modules/audio_coding/main/test/opus_test.cc b/webrtc/modules/audio_coding/main/test/opus_test.cc index 1dd42c980d..3c9adb7019 100644 --- a/webrtc/modules/audio_coding/main/test/opus_test.cc +++ b/webrtc/modules/audio_coding/main/test/opus_test.cc @@ -219,6 +219,7 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate, int written_samples = 0; int read_samples = 0; int decoded_samples = 0; + channel->reset_payload_size(); counter_ = 0; @@ -226,7 +227,8 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate, EXPECT_EQ(0, WebRtcOpus_SetBitRate(opus_mono_encoder_, bitrate)); EXPECT_EQ(0, WebRtcOpus_SetBitRate(opus_stereo_encoder_, bitrate)); - while (1) { + // Make sure the runtime is less than 60 seconds to pass Android test. + for (size_t audio_length = 0; audio_length < 10000; audio_length += 10) { bool lost_packet = false; // Get 10 msec of audio.