summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelicia Lim <flim@google.com>2016-10-31 11:58:26 -0700
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-10-31 15:42:12 -0400
commit8fec416b7dd479b8b7c34b63b3ab4dbcf7abcdca (patch)
tree3c5fa17d7ffa33226aabcabdec49cd946e3358ae
parent7e122394e63b3a3a07900153c4ee046b16462702 (diff)
downloadopus-8fec416b7dd479b8b7c34b63b3ab4dbcf7abcdca.tar.gz
Fix amount of extra bytes reserved for 100 ms
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
-rw-r--r--src/opus_multistream_encoder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c
index 83e17584..f0b9ae42 100644
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -1039,9 +1039,9 @@ static int opus_multistream_encode_native
curr_max = max_data_bytes - tot_size;
/* Reserve one byte for the last stream and two for the others */
curr_max -= IMAX(0,2*(st->layout.nb_streams-s-1)-1);
- /* For 100 ms, reserve an extra byte per stream for the Toc */
+ /* For 100 ms, reserve an extra byte per stream for the ToC */
if (Fs/frame_size == 10)
- curr_max -= st->layout.nb_streams-s;
+ curr_max -= st->layout.nb_streams-s-1;
curr_max = IMIN(curr_max,MS_FRAME_TMP);
/* Repacketizer will add one or two bytes for self-delimited frames */
if (s != st->layout.nb_streams-1) curr_max -= curr_max>253 ? 2 : 1;