Returning correct duration estimate on Opus DTX packets.
Bug 4985 revealed two flaws 1. Opus duration estimate did not return correct length for DTX packets, 2. NetEq DoCodecInternalCng did not assign enough buffer. P.S. Generalizing problem 1, current NetEq decode function checks memory size by calling the duration estimate function. This is not ideal. A better way is to let codec's decode function to receive buffer size and return failure if it is not enough. This can be made in a separate CL. BUG=webrtc:4985 R=henrik.lundin@webrtc.org Review URL: https://codereview.webrtc.org/1334303005 . Cr-Commit-Position: refs/heads/master@{#10031}
This commit is contained in:
@ -105,9 +105,12 @@ int OpusTest::EncodeDecode(WebRtcOpusEncInst* encoder,
|
||||
kMaxBytes, bitstream_);
|
||||
EXPECT_GE(encoded_bytes_int, 0);
|
||||
encoded_bytes_ = static_cast<size_t>(encoded_bytes_int);
|
||||
return WebRtcOpus_Decode(decoder, bitstream_,
|
||||
encoded_bytes_, output_audio,
|
||||
audio_type);
|
||||
int est_len = WebRtcOpus_DurationEst(decoder, bitstream_, encoded_bytes_);
|
||||
int act_len = WebRtcOpus_Decode(decoder, bitstream_,
|
||||
encoded_bytes_, output_audio,
|
||||
audio_type);
|
||||
EXPECT_EQ(est_len, act_len);
|
||||
return act_len;
|
||||
}
|
||||
|
||||
// Test if encoder/decoder can enter DTX mode properly and do not enter DTX when
|
||||
|
||||
Reference in New Issue
Block a user