Skip to content

Commit e06a701

Browse files
committed
include: Clarify lifetime of RWops in Mix_LoadMUS* calls with freesrc!=0.
Fixes #683. (cherry picked from commit bd3185b)
1 parent 4e9a308 commit e06a701

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

include/SDL3_mixer/SDL_mixer.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,11 @@ extern SDL_DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file);
482482
* fly. Also, crucially, there are as many channels for chunks as the app can
483483
* allocate, but SDL_mixer only offers a single "music" channel.
484484
*
485-
* If `closeio` is true, the IOStream will be closed before returning, whether
486-
* this function succeeds or not. SDL_mixer reads everything it needs from the
487-
* IOStream during this call in any case.
485+
* If `closeio` is true, the SDL_IOStream will be closed when SDL_mixer is
486+
* done with it, which will be before this function call returns if there is
487+
* an error, or perhaps much later if the music is streaming for some time.
488+
* The app should not attempt to use the stream again, as it may become
489+
* invalid without warning.
488490
*
489491
* As a convenience, there is a function to read files from disk without
490492
* having to deal with SDL_IOStream: `Mix_LoadMUS("filename.mp3")` will manage
@@ -542,9 +544,11 @@ extern SDL_DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_IO(SDL_IOStream *src, bool c
542544
* - `MUS_OPUS` (Opus files)
543545
* - `MUS_WAVPACK` (WavPack files)
544546
*
545-
* If `closeio` is true, the IOStream will be closed before returning, whether
546-
* this function succeeds or not. SDL_mixer reads everything it needs from the
547-
* IOStream during this call in any case.
547+
* If `closeio` is true, the SDL_IOStream will be closed when SDL_mixer is
548+
* done with it, which will be before this function call returns if there is
549+
* an error, or perhaps much later if the music is streaming for some time.
550+
* The app should not attempt to use the stream again, as it may become
551+
* invalid without warning.
548552
*
549553
* As a convenience, there is a function to read files from disk without
550554
* having to deal with SDL_IOStream: `Mix_LoadMUS("filename.mp3")` will manage

0 commit comments

Comments
 (0)