mirror of https://github.com/libsdl-org/SDL.git
Merge fd2be08734 into 038a3806eb
This commit is contained in:
commit
c4151fad46
|
|
@ -1064,6 +1064,15 @@ extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_Au
|
||||||
/**
|
/**
|
||||||
* Get the properties associated with an audio stream.
|
* Get the properties associated with an audio stream.
|
||||||
*
|
*
|
||||||
|
* The application can hang any data it wants here, but
|
||||||
|
* the following properties are understood by SDL:
|
||||||
|
*
|
||||||
|
* - `SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN`: if true, the stream will
|
||||||
|
* not be automatically destroyed during SDL_Quit(). This property is
|
||||||
|
* ignored for streams created through SDL_OpenAudioDeviceStream(). Streams
|
||||||
|
* bound to devices that aren't destroyed will still be unbound.
|
||||||
|
* Default false. (since SDL 3.4.0)
|
||||||
|
*
|
||||||
* \param stream the SDL_AudioStream to query.
|
* \param stream the SDL_AudioStream to query.
|
||||||
* \returns a valid property ID on success or 0 on failure; call
|
* \returns a valid property ID on success or 0 on failure; call
|
||||||
* SDL_GetError() for more information.
|
* SDL_GetError() for more information.
|
||||||
|
|
@ -1074,6 +1083,9 @@ extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_Au
|
||||||
*/
|
*/
|
||||||
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
|
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);
|
||||||
|
|
||||||
|
#define SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN "SDL.audiostream.keep_on_shutdown"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the current format of an audio stream.
|
* Query the current format of an audio stream.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1073,9 +1073,16 @@ void SDL_QuitAudio(void)
|
||||||
|
|
||||||
current_audio.impl.DeinitializeStart();
|
current_audio.impl.DeinitializeStart();
|
||||||
|
|
||||||
// Destroy any audio streams that still exist...
|
// Destroy any audio streams that still exist...unless app asked to keep it.
|
||||||
while (current_audio.existing_streams) {
|
SDL_AudioStream *next = NULL;
|
||||||
SDL_DestroyAudioStream(current_audio.existing_streams);
|
for (SDL_AudioStream *i = current_audio.existing_streams; i; i = next) {
|
||||||
|
next = i->next;
|
||||||
|
if (i->simplified || !SDL_GetBooleanProperty(i->props, SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN, false)) {
|
||||||
|
SDL_DestroyAudioStream(i);
|
||||||
|
} else {
|
||||||
|
i->prev = NULL;
|
||||||
|
i->next = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_LockRWLockForWriting(current_audio.device_hash_lock);
|
SDL_LockRWLockForWriting(current_audio.device_hash_lock);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue