-
Notifications
You must be signed in to change notification settings - Fork 2.3k
audio: Let apps save an audio stream from destruction during SDL_Quit(). #13244
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
audio: Let apps save an audio stream from destruction during SDL_Quit(). #13244
Conversation
This is a special-case piece of functionality, generally these are expected to go away during shutdown, but maybe someone is switching between audio subsystems or something...
SDL_zero(current_audio); Hmmm... |
Maybe we can add a test case to validate this functionality? |
What if the requested audio back end changes between quit and init? Or is that of no concern? |
After sleeping on it, I'm inclined to think that audio streams are the audio equivalent of SDL surfaces and shouldn't be automatically cleaned up unless they're bound to devices. |
If we do want this, I updated the PR to just orphan the streams rather than try to keep them in the list for the next audio open. |
There isn't any backend-specific code in an audio stream...even being bound to a device just means the device thread pulls from the stream. |
That's an ABI break, though (and more confusing, because sometimes they go away and sometimes they don't). |
Yeah, this is better. |
Yep, agreed. |
And then we'll set this property in the new SDL_mixer for streams not associated with a device? |
Yeah, that's the plan. Should we merge this, then, or is there more to do? |
I’m still mulling over the name… persist on shutdown? Auto cleanup = false? But we can squash and merge as-is. |
I went ahead and renamed SDL_PROP_AUDIOSTREAM_KEEP_ON_SHUTDOWN_BOOLEAN to SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN. Let me know if you disagree! |
lgtm, I'll put this in SDL_remixer. |
This is a special-case piece of functionality, generally these are expected to go away during shutdown, but maybe someone is switching between audio subsystems or something...