diff src/audio/SDL_audio.c @ 3786:b70f4e9291bb SDL-ryan-multiple-audio-device

High level now lets user select a specific audio device with an environment variable, when the app requested the default device.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 03 Oct 2006 16:02:08 +0000
parents 37c9c4590689
children 8d74a4721ca9
line wrap: on
line diff
--- a/src/audio/SDL_audio.c	Tue Oct 03 05:58:44 2006 +0000
+++ b/src/audio/SDL_audio.c	Tue Oct 03 16:02:08 2006 +0000
@@ -572,6 +572,11 @@
         return 0;
     }
 
+    /* If app doesn't care about a specific device, let the user override. */
+    if (devname == NULL) {
+        devname = SDL_getenv("SDL_AUDIO_DEVICE_NAME");
+    }
+
     device = (SDL_AudioDevice *) SDL_AllocAudioMem(sizeof (SDL_AudioDevice));
     if (device == NULL) {
         SDL_OutOfMemory();