diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2014-09-04 10:44:09 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2014-09-04 10:44:09 +0400 |
commit | 648eb9adff253c1216a5430237cc8df30cce6751 (patch) | |
tree | 872f7216af091fbb921a8ed25020a7efe39ab063 /src | |
parent | e1326fe6c8a246aa0b98074040542e3b8ca14c53 (diff) |
Takes into account a corner case with the multistream encoder
Considers the case where one stream would eat up all the remaining bytes,
including a 2-byte size that would then not leave enough for the even a PLC
packet in the next streams.
Diffstat (limited to 'src')
-rw-r--r-- | src/opus_multistream_encoder.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c index 854f85e3..bdacff1a 100644 --- a/src/opus_multistream_encoder.c +++ b/src/opus_multistream_encoder.c @@ -864,7 +864,7 @@ static int opus_multistream_encode_native curr_max -= IMAX(0,2*(st->layout.nb_streams-s-1)-1); curr_max = IMIN(curr_max,MS_FRAME_TMP); /* Repacketizer will add one byte for self-delimited frames */ - if (s != st->layout.nb_streams-1) curr_max--; + if (s != st->layout.nb_streams-1) curr_max -= curr_max>253 ? 2 : 1; if (!vbr && s == st->layout.nb_streams-1) opus_encoder_ctl(enc, OPUS_SET_BITRATE(curr_max*(8*Fs/frame_size))); len = opus_encode_native(enc, buf, frame_size, tmp_data, curr_max, lsb_depth, |