# HG changeset patch # User Ryan C. Gordon # Date 1159891328 0 # Node ID b70f4e9291bb2e446a80a76b91a440313b0c5030 # Parent da2ea0694d11ccf5f7fc5943c0d561e8124ca7da High level now lets user select a specific audio device with an environment variable, when the app requested the default device. diff -r da2ea0694d11 -r b70f4e9291bb src/audio/SDL_audio.c --- 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(); diff -r da2ea0694d11 -r b70f4e9291bb src/audio/macosx/SDL_coreaudio.c --- 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;