audio: SDL_OpenAudioDeviceStream() now allows a NULL spec.

This commit is contained in:
Ryan C. Gordon committed 2024-05-25 23:34:01 -04:00
1 parent 6a40a8eb12
commit 033793faed
2 files changed
+14 -2

No files matched your search

+7
View File
@@ -1976,6 +1976,13 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au
SDL_assert(device != NULL);
const SDL_bool iscapture = device->iscapture;
// if the app didn't request a format _at all_, just make a stream that does no conversion; they can query for it later.
SDL_AudioSpec tmpspec;
if (!spec) {
SDL_copyp(&tmpspec, &device->spec);
spec = &tmpspec;
}
if (iscapture) {
stream = SDL_CreateAudioStream(&device->spec, spec);
} else {