Make Opus PLC always output 10ms audio.

BUG: b/143582588
Change-Id: I41ad5f4f91d9af3f595666a8f32b7ab5382605bd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158672
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29733}
This commit is contained in:
Minyue Li
2019-11-04 14:47:52 +01:00
committed by Commit Bot
parent 0696eecbd0
commit 8e83c7ac09
7 changed files with 116 additions and 45 deletions

View File

@ -154,8 +154,13 @@ void OpusFecTest::DecodeABlock(bool lost_previous, bool lost_current) {
WebRtcOpus_DecodeFec(opus_decoder_, &bit_stream_[0], encoded_bytes_,
&out_data_[0], &audio_type);
} else {
value_1 =
WebRtcOpus_Decode(opus_decoder_, NULL, 0, &out_data_[0], &audio_type);
// Call decoder PLC.
while (value_1 < static_cast<int>(block_length_sample_)) {
int ret = WebRtcOpus_Decode(opus_decoder_, NULL, 0, &out_data_[value_1],
&audio_type);
EXPECT_EQ(ret, sampling_khz_ * 10); // Should return 10 ms of samples.
value_1 += ret;
}
}
EXPECT_EQ(static_cast<int>(block_length_sample_), value_1);
}