Correct multistream variable frame size stride

The multistream encoder input has st->layout.nb_channels channels.
The number of channels actually encoded is st->layout.nb_streams +
st->layout.nb_coupled_streams, which may be fewer, so ideally it
would only analyze those when computing the optimal frame size, but
there is no code to do that currently.
This commit is contained in:
Mark Harris 2016-08-27 07:10:15 -07:00
parent 3421f6d2ba
commit 7d0e33f7f1

View file

@ -861,13 +861,11 @@ static int opus_multistream_encode_native
{
opus_int32 delay_compensation;
int channels;
channels = st->layout.nb_streams + st->layout.nb_coupled_streams;
opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_LOOKAHEAD(&delay_compensation));
delay_compensation -= Fs/400;
frame_size = compute_frame_size(pcm, analysis_frame_size,
st->variable_duration, channels, Fs, st->bitrate_bps,
st->variable_duration, st->layout.nb_channels, Fs, st->bitrate_bps,
delay_compensation, downmix
#ifndef DISABLE_FLOAT_API
, st->subframe_mem