From: Gregory Maxwell Date: Tue, 29 Nov 2011 04:19:08 +0000 (-0500) Subject: Fixes the code for optional self-delimited packing to make it fit the draft X-Git-Tag: v0.9.9~14 X-Git-Url: http://git.xiph.org/?p=opus.git;a=commitdiff_plain;h=92c896e8806ec34c826e638512f7e33f1c9edcd0 Fixes the code for optional self-delimited packing to make it fit the draft This has no impact on opus_demo, test vectors, or "normal" codec operation --- diff --git a/src/opus_multistream.c b/src/opus_multistream.c index 945424f..a2a48b9 100644 --- a/src/opus_multistream.c +++ b/src/opus_multistream.c @@ -108,7 +108,7 @@ static int get_mono_channel(const ChannelLayout *layout, int stream_id, int prev i = (prev<0) ? 0 : prev+1; for (;inb_channels;i++) { - if (layout->mapping[i]==2*layout->nb_coupled_streams+stream_id) + if (layout->mapping[i]==stream_id+layout->nb_coupled_streams) return i; } return -1; diff --git a/src/repacketizer.c b/src/repacketizer.c index 1caa2fe..dd923a2 100644 --- a/src/repacketizer.c +++ b/src/repacketizer.c @@ -111,7 +111,7 @@ opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int len = rp->len+begin; frames = rp->frames+begin; if (self_delimited) - tot_size = 1 + len[count-1]>=252; + tot_size = 1 + (len[count-1]>=252); else tot_size = 0; @@ -184,7 +184,6 @@ opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int } if (self_delimited) { int sdlen = encode_size(len[count-1], data); - tot_size += sdlen; data += sdlen; } /* Copy the actual data */