Open martinflorek opened 7 months ago
master
Decoding SILK OGG OPUS streams and some of them are changing from to CELT codec after some time and thus failing.
Proper decoding of the of the whole SILK encoded stream
oggreader returned error that CELT is not supported
The problem is in the loop that is reading the segments. It does not handle the case if the segment's length is 255, which means that the OPUS packet spans multiple segments https://github.com/pion/opus/blob/8667a1a251735fc6128dc7d5077d1d817bd2230a/pkg/oggreader/oggreader.go#L157
Pseudo code of the correct loop can be found at https://gist.github.com/amishshah/68548e803c3208566e36e55fe1618e1c
Implementing something similar in my own, heavily modified oggreader, solved all the decoding problems.
Your environment.
master
What did you do?
Decoding SILK OGG OPUS streams and some of them are changing from to CELT codec after some time and thus failing.
What did you expect?
Proper decoding of the of the whole SILK encoded stream
What happened?
oggreader returned error that CELT is not supported
Fix
The problem is in the loop that is reading the segments. It does not handle the case if the segment's length is 255, which means that the OPUS packet spans multiple segments https://github.com/pion/opus/blob/8667a1a251735fc6128dc7d5077d1d817bd2230a/pkg/oggreader/oggreader.go#L157
Pseudo code of the correct loop can be found at https://gist.github.com/amishshah/68548e803c3208566e36e55fe1618e1c
Implementing something similar in my own, heavily modified oggreader, solved all the decoding problems.