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

Fix one instance of invalid OGG Opus duration extraction #103

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

devoxin
Copy link
Member

@devoxin devoxin commented Apr 28, 2024

Fixes an issue where the retrieved sampleRate value was an arbitrary number, not indicative of the actual sample rate. This lead to invalid duration values.

This seems to be caused by an error in the firstPacket buffer contents after reading comments and tags, so it's read before any of that occurs.

This has been tested and appears to work correctly, yielding the correct value of 48000 in my test files.

This commit has also been tested and is inline with the ID header specification found at https://wiki.xiph.org/OggOpus#ID_Header

@devoxin devoxin merged commit 9a91acd into main Apr 28, 2024
1 check passed
@devoxin devoxin deleted the fix-ogg-opus-duration-extraction branch April 28, 2024 22:18
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

Successfully merging this pull request may close these issues.

2 participants