lavalink-devs / lavaplayer

Lavaplayer fork maintained by Lavalink
Apache License 2.0
187 stars 51 forks source link

[v1-legacy] Fix one instance of invalid OGG Opus duration extraction #104

Closed devoxin closed 6 months ago

devoxin commented 6 months ago

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