Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParseNextPage() in oggreader.go does not handle OPUS packets that span multiple segments #49

Open
martinflorek opened this issue Mar 25, 2024 · 0 comments

Comments

@martinflorek
Copy link

Your environment.

  • Version: 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

for _, s := range sizeBuffer {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant