audio: An enormous amount of work on managing default devices.

This commit is contained in:
Ryan C. Gordon committed 2023-07-30 11:55:55 -04:00
1 parent c7a44eea83
commit ee10bab3cd
5 files changed
+314 -87

No files matched your search

+1 -3
View File
@@ -86,9 +86,7 @@ close_audio(void)
static void
open_audio(void)
{
SDL_AudioDeviceID *devices = SDL_GetAudioOutputDevices(NULL);
device = devices ? SDL_OpenAudioDevice(devices[0], &wave.spec) : 0;
SDL_free(devices);
device = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_OUTPUT, &wave.spec);
if (!device) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't open audio: %s\n", SDL_GetError());
SDL_free(wave.sound);