Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2011-09-28 22:23:01 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2011-09-28 22:23:01 +0400
commite4de8a9c769847110e94a030c5e7d40831da71f0 (patch)
tree30b4cc8c3538f05f1efa2ab7c14110b6d069b51b /silk/enc_API.c
parent744e59ef01f228923f35a504d9552dd1c8d7a23c (diff)
Fixes a bug that was falsely triggering DTX for 60 ms stereo
There's still a range coder mismatch on the first frame when using FEC.
Diffstat (limited to 'silk/enc_API.c')
-rw-r--r--silk/enc_API.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/silk/enc_API.c b/silk/enc_API.c
index ccf98b66..5f9009bf 100644
--- a/silk/enc_API.c
+++ b/silk/enc_API.c
@@ -139,6 +139,8 @@ opus_int silk_Encode(
silk_encoder *psEnc = ( silk_encoder * )encState;
opus_int16 buf[ MAX_FRAME_LENGTH_MS * MAX_API_FS_KHZ ];
+ psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded = psEnc->state_Fxx[ 1 ].sCmn.nFramesEncoded = 0;
+
/* Check values in encoder control structure */
if( ( ret = check_control_input( encControl ) != 0 ) ) {
silk_assert( 0 );
@@ -358,13 +360,13 @@ opus_int silk_Encode(
silk_assert( 0 );
}
}
-
+ psEnc->state_Fxx[ n ].sCmn.nFramesEncoded++;
psEnc->state_Fxx[ n ].sCmn.controlled_since_last_payload = 0;
psEnc->state_Fxx[ n ].sCmn.inputBufIx = 0;
}
/* Insert VAD and FEC flags at beginning of bitstream */
- if( *nBytesOut > 0 ) {
+ if( *nBytesOut > 0 && psEnc->state_Fxx[ 0 ].sCmn.nFramesEncoded == psEnc->state_Fxx[ 0 ].sCmn.nFramesPerPacket) {
flags = 0;
for( n = 0; n < encControl->nChannelsInternal; n++ ) {
for( i = 0; i < psEnc->state_Fxx[ n ].sCmn.nFramesPerPacket; i++ ) {