Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@binary1248
Copy link
Member

Title.

It seems like the vorbis implementation has been somewhat buggy for some time.

After opening an ogg stream and reading its header information with ov_info(), in certain cases (certain files) the internal stream read position isn't properly reset back to the beginning. This causes a subsequent call to ov_pcm_total() to return a wrong total sample count. Reading in sample data using ov_read() based on this incorrect sample count will then return less samples than what was reported leading to the entire file failing to load. Explicitly resetting the stream read position back to the beginning of the file using ov_raw_seek() after calling ov_info() seems to work around this problem.

Assuming that this bug will realistically never get fixed, I don't have any reservations about building in this workaround. Glancing over the vorbis issue tracker it is unlikely most reported bugs will ever get fixed.

All the information necessary to reproduce the bug and test this fix can be found in #3578.

Fixes #3578

@kimci86
Copy link
Contributor

kimci86 commented Sep 24, 2025

What about adding a test for a file that used to fail to open?

@binary1248
Copy link
Member Author

If someone can provide a file with appropriate license that causes the issue then I can add it.

@Legulysse
Copy link

If someone can provide a file with appropriate license that causes the issue then I can add it.

If I want to provide you with files from my project for the need of tests, is there something in particular I should do ?

@eXpl0it3r eXpl0it3r added this to the 3.1 milestone Sep 28, 2025
@github-project-automation github-project-automation bot moved this to Planned in SFML 3.1.0 Sep 28, 2025
@eXpl0it3r eXpl0it3r moved this from Planned to In Review in SFML 3.1.0 Sep 28, 2025
@eXpl0it3r
Copy link
Member

We don't have some CLA set up to facilitate an easy adoption of resources.

I guess one option is to publicly release the files with a reusable license. Elijah who created some assets used in the SFML examples has done so in the past: https://github.com/elijahfhopp/public-domain

Maybe for tests it's less relevant? The main "issue" in a sense is distribution on platforms like Debian that only uses assets that are clearly licensed. Then again, they do run our test suite as well during the build step.

Anyways, I don't want this to block the fix. Feel free to open a PR with a proposal on how to integrate the asset.

@eXpl0it3r eXpl0it3r merged commit df49e32 into master Oct 1, 2025
532 of 544 checks passed
@eXpl0it3r eXpl0it3r deleted the bugfix/ogg_sample_count branch October 1, 2025 21:19
@github-project-automation github-project-automation bot moved this from In Review to Done in SFML 3.1.0 Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Unsupported audio files (ogg/wav)

6 participants