Update tests and DTX check for Opus 1.1.3.

DTX is now indicated by packets that may have a size of up to 2 bytes.
Ref: https://git.xiph.org/?p=opus.git;a=commit;h=1c311423c86b89eba27a494e17c79fefd7d75ab0

BUG=

Review-Url: https://codereview.webrtc.org/2158293003
Cr-Commit-Position: refs/heads/master@{#13736}
This commit is contained in:
flim
2016-08-12 04:36:05 -07:00
committed by Commit bot
parent 9591e3e82d
commit 64a7eab891
3 changed files with 28 additions and 22 deletions

View File

@ -95,7 +95,11 @@ int WebRtcOpus_Encode(OpusEncInst* inst,
encoded,
(opus_int32)length_encoded_buffer);
if (res == 1) {
if (res <= 0) {
return -1;
}
if (res <= 2) {
// Indicates DTX since the packet has nothing but a header. In principle,
// there is no need to send this packet. However, we do transmit the first
// occurrence to let the decoder know that the encoder enters DTX mode.
@ -105,12 +109,10 @@ int WebRtcOpus_Encode(OpusEncInst* inst,
inst->in_dtx_mode = 1;
return 1;
}
} else if (res > 1) {
inst->in_dtx_mode = 0;
return res;
}
return -1;
inst->in_dtx_mode = 0;
return res;
}
int16_t WebRtcOpus_SetBitRate(OpusEncInst* inst, int32_t rate) {