Fix multistream packet corruption, implement GET_FINAL_RANGE for multistream, and add many tests.

Multistream encode was failing to add the length of the extra length for
self-delimited packets causing corrupted output. Multistream decode was
not properly handling lost frames (and potentially reading out of bounds
as a result).

GET_FINAL_RANGE has been implemented as the xor of the final range of all
the streams in the packet.

test_opus_encode now does the mono narrowband tests using dual-mono
multistream.
This commit is contained in:
Gregory Maxwell 2011-10-30 19:57:22 -04:00
parent b77c44b46f
commit afd05aca0c
4 changed files with 142 additions and 34 deletions

View file

@ -182,8 +182,11 @@ opus_int32 opus_repacketizer_out_range_impl(OpusRepacketizer *rp, int begin, int
}
break;
}
if (self_delimited)
data += encode_size(len[count-1], data);
if (self_delimited) {
int sdlen = encode_size(len[count-1], data);
tot_size += sdlen;
data += sdlen;
}
/* Copy the actual data */
for (i=0;i<count;i++)
{