Skip to content

SDL_mixer: Possible error in the wiki (and in SDL_mixer.h) #683

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

Open
viglietta opened this issue Nov 6, 2024 · 0 comments
Open

SDL_mixer: Possible error in the wiki (and in SDL_mixer.h) #683

viglietta opened this issue Nov 6, 2024 · 0 comments

Comments

@viglietta
Copy link

viglietta commented Nov 6, 2024

The SDL_mixer wiki page on Mix_LoadMUS_IO (https://wiki.libsdl.org/SDL3_mixer/Mix_LoadMUS_IO), as well as SDL_mixer.h, reads:

If closeio is true, the IOStream will be closed before returning, whether this function succeeds or not.
SDL_mixer reads everything it needs from the IOStream during this call in any case.

The second sentence appears misleading at best, as it seems to suggest that the buffer associated with the IO stream can be altered or freed by the user while SDL_mixer is still playing music therein. However, looking at the source code of SDL_mixer, it seems that the buffer is never actually copied internally, but simply read on the fly as the music plays. So, if I understand it correctly, the user may not free the buffer passed to the IO stream until Mix_FreeMusic is called. I think the wiki should state this explicitly.

@slouken slouken transferred this issue from libsdl-org/SDL Mar 21, 2025
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