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

[Vorbisfile] Incorrect offsets and broken tell/seek function #60

Open
Zuzu-Typ opened this issue Jan 11, 2020 · 0 comments
Open

[Vorbisfile] Incorrect offsets and broken tell/seek function #60

Zuzu-Typ opened this issue Jan 11, 2020 · 0 comments

Comments

@Zuzu-Typ
Copy link

Using vorbis 1.3.6, when trying to decode an example Ogg-Vorbis file from Wikipedia, it always starts reading at an offset (of 11968 samples or 0.27138321995464854s respectively).
Setting this offset to 0 using ov_pcm_seek(), it still reads from said offset, even though ov_pcm_tell() still returns 0.

When trying to read samples after seeking to 0, the tell position suddenly jumps:

0...
1024...
2048...
3072...
4096...
5120...
6144...
7168...
8192...
9216...
22208 ; what??

Although you might not see it at first glance, but the tell function was lying to you all along.
We're reading 10 x 1024 samples, or 10240 total samples.
If you add those to the initial offset of 11968, you get (surprise) 22208.
So seek didn't do it's job and neither did tell.

The data is also read from the offset and not the beginning of the file.

Whatever I tried, I could not get vorbisfile to decode the first part of the file for some reason.
It's not broken either - I could open it with Audacity, VLC, Groove, etc.

I've also tried both ov_read and ov_read_float.

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