opus_repacketizer_cat sometimes fails
Hello. I found a behavior that seems to be a bug and I would like to report it.
opus_repacketizer_cat() sometimes failed with certain data. Attached is a file for reproduction with the data.
> gcc bug.c -I./include -L./.libs -lopus -o bug.exe && ./bug.exe
[41] failed repacketizer corrupted stream(-4)
The following line caused opus_repacketizer_cat() to generate an error. it seemed to be a direct result of the TOC being different. I could not figure out why the TOC was changing.
I have confirmed reproduction with libopus1.4. If I change from OPUS_APPLICATION_AUDIO to VOIP, the problem does not occur. Sorry if I misunderstood something.
If the encoder decided to switch mode between two packets, then the packets cannot be merged into a single packet. Basically, the repacketizer isn't guaranteed to always succeed in the general case.