opus icon indicating copy to clipboard operation
opus copied to clipboard

opus_repacketizer_cat sometimes fails

Open takahiro-kawanaka opened this issue 1 year ago • 1 comments

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.

bug.zip

> 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. image

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.

takahiro-kawanaka avatar Mar 25 '24 10:03 takahiro-kawanaka

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.

jmvalin avatar Nov 21 '25 16:11 jmvalin