ref: 7ef6c7c1b465df4ef3b4ece2ecbf9d35c625beb4
parent: d9dd4992da714aabcc8a3eafa5fcae1c21c50a71
author: Jean-Marc Valin <[email protected]>
date: Mon Oct 17 10:20:43 EDT 2011
This should fix switching from SILK/hybrid to 60ms CELT
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -662,6 +662,9 @@
{
int tmp_len;
st->silk_mode.toMono = 0;
+ /* When switching from SILK/Hybrid to CELT, only ask for a switch at the last frame */
+ if (to_celt && i==nb_frames-1)
+ st->user_forced_mode = MODE_CELT_ONLY;
tmp_len = opus_encode_native(st, pcm+i*(st->channels*st->Fs/50), st->Fs/50, tmp_data+i*bytes_per_frame, bytes_per_frame);
ret = opus_repacketizer_cat(rp, tmp_data+i*bytes_per_frame, tmp_len);
}