diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c index 985a84130b556b538e6fe1de6c886262d00a0b19..3065b6f77b0c5155ba35bb94712d81d5a69fddee 100644 --- a/src/opus_multistream_encoder.c +++ b/src/opus_multistream_encoder.c @@ -222,8 +222,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b { int c; int i; - /* FIXME: pass LM properly */ - int LM=3; + int LM; int pos[8] = {0}; int upsample; int frame_size; @@ -237,6 +236,10 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b upsample = resampling_factor(rate); frame_size = len*upsample; + for (LM=0;LM<=celt_mode->maxLM;LM++) + if (celt_mode->shortMdctSize<<LM==frame_size) + break; + ALLOC(in, frame_size+overlap, opus_val32); ALLOC(x, len, opus_val16); ALLOC(freq, frame_size, opus_val32);