changeset 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 da2ea0694d11
children 8d74a4721ca9
files src/audio/SDL_audio.c src/audio/macosx/SDL_coreaudio.c
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
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();
--- a/src/audio/macosx/SDL_coreaudio.c	Tue Oct 03 05:58:44 2006 +0000
+++ b/src/audio/macosx/SDL_coreaudio.c	Tue Oct 03 16:02:08 2006 +0000
@@ -223,8 +223,11 @@
     UInt32 remaining, len;
     void *ptr;
 
+    /*
+     * !!! FIXME: I'm not sure if you can ever have more than one
+     *            buffer, or what this signifies, or what to do with it...
+     */
     if (ioDataList->mNumberBuffers != 1) {
-        fprintf(stderr, "!!! FIXME SDL!\n");
         return noErr;
     }
 
@@ -406,10 +409,6 @@
     const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output :
                                                 kAudioUnitScope_Input);
 
-    /* !!! FIXME: move something like this to higher level. */
-    if ( (devname == NULL) && (SDL_getenv("SDL_AUDIO_DEVNAME")) )
-        devname = SDL_getenv("SDL_AUDIO_DEVNAME");
-
     if (!find_device_by_name(this, devname, iscapture)) {
         SDL_SetError("Couldn't find requested CoreAudio device");
         return 0;