diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-12 23:09:13 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-12 23:09:13 +0400 |
commit | 4f1b7dac7e3b1ed0c9acce9c208c8c972f3d95d4 (patch) | |
tree | 3e1bfa8c5c7498d494ee2c60987cd7cc81923638 /silk/dec_API.c | |
parent | e2a6aaa73158d4e9415a7e053f84f83314e2d9e3 (diff) |
Fixes a case where PLC was called on the side when no side was ever coded
Diffstat (limited to 'silk/dec_API.c')
-rw-r--r-- | silk/dec_API.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/silk/dec_API.c b/silk/dec_API.c index d98f74c6..ade060f9 100644 --- a/silk/dec_API.c +++ b/silk/dec_API.c @@ -229,7 +229,7 @@ opus_int silk_Decode( /* Call decoder for one frame */ for( n = 0; n < decControl->nChannelsInternal; n++ ) { - if( n == 0 || decode_only_middle == 0 ) { + if( n == 0 || ( ( lostFlag != FLAG_PACKET_LOST ? decode_only_middle : psDec->prev_decode_only_middle ) == 0 ) ) { ret += silk_decode_frame( &channel_state[ n ], psRangeDec, &samplesOut1_tmp[ n ][ 2 + delay ], &nSamplesOutDec, lostFlag ); } else { silk_memset( &samplesOut1_tmp[ n ][ 2 + delay ], 0, nSamplesOutDec * sizeof( opus_int16 ) ); @@ -285,8 +285,9 @@ opus_int silk_Decode( decControl->prevPitchLag = 0; } - psDec->prev_decode_only_middle = decode_only_middle; - + if ( lostFlag != FLAG_PACKET_LOST ) { + psDec->prev_decode_only_middle = decode_only_middle; + } return ret; } |