# HG changeset patch # User Ryan C. Gordon # Date 1159999809 0 # Node ID 3decf9cdeb63982e8a25a45b7447d0c432b09539 # Parent cef5d927591fe10c588499ddada82bc28e7a9852 Removed ESD cruft from the core...now the driver will use esound if there's an ESPEAKER variable set for a remote host, or the daemon is already running on the local host, but it won't spawn it. Hopefully this works out okay. diff -r cef5d927591f -r 3decf9cdeb63 src/audio/SDL_audio.c --- a/src/audio/SDL_audio.c Wed Oct 04 21:58:48 2006 +0000 +++ b/src/audio/SDL_audio.c Wed Oct 04 22:10:09 2006 +0000 @@ -370,48 +370,11 @@ SDL_memset(¤t_audio, '\0', sizeof (current_audio)); SDL_memset(open_devices, '\0', sizeof (open_devices)); - /* !!! FIXME: build a priority list of available drivers... */ - /* Select the proper audio driver */ if (driver_name == NULL) { driver_name = SDL_getenv("SDL_AUDIODRIVER"); } -/* !!! FIXME: move this esound shite into the esound driver... */ -#if SDL_AUDIO_DRIVER_ESD - if ((driver_name == NULL) && (SDL_getenv("ESPEAKER") != NULL)) { - /* Ahem, we know that if ESPEAKER is set, user probably wants - to use ESD, but don't start it if it's not already running. - This probably isn't the place to do this, but... Shh! :) - */ - for (i = 0; bootstrap[i]; ++i) { - if (SDL_strcasecmp(bootstrap[i]->name, "esd") == 0) { -#ifdef HAVE_PUTENV - const char *esd_no_spawn; - - /* Don't start ESD if it's not running */ - esd_no_spawn = getenv("ESD_NO_SPAWN"); - if (esd_no_spawn == NULL) { - putenv("ESD_NO_SPAWN=1"); - } -#endif - if (bootstrap[i]->available()) { - SDL_memset(¤t_audio, 0, sizeof (current_audio)); - current_audio.name = bootstrap[i]->name; - current_audio.desc = bootstrap[i]->desc; - initialized = bootstrap[i]->init(¤t_audio.impl); - break; - } -#ifdef HAVE_UNSETENV - if (esd_no_spawn == NULL) { - unsetenv("ESD_NO_SPAWN"); - } -#endif - } - } - } -#endif /* SDL_AUDIO_DRIVER_ESD */ - if (!initialized) { if (driver_name != NULL) { for (i = 0; bootstrap[i]; ++i) { diff -r cef5d927591f -r 3decf9cdeb63 src/audio/esd/SDL_esdaudio.c --- a/src/audio/esd/SDL_esdaudio.c Wed Oct 04 21:58:48 2006 +0000 +++ b/src/audio/esd/SDL_esdaudio.c Wed Oct 04 22:10:09 2006 +0000 @@ -126,10 +126,14 @@ static int Audio_Available(void) { - int connection; - int available; + const char *esd_no_spawn = SDL_getenv("ESD_NO_SPAWN"); + int connection = 0; + int available = 0; - available = 0; + if (esd_no_spawn == NULL) { + SDL_putenv("ESD_NO_SPAWN=1"); /* Don't start ESD if it's not running */ + } + if (LoadESDLibrary() < 0) { return available; } @@ -139,7 +143,7 @@ SDL_NAME(esd_close) (connection); } UnloadESDLibrary(); - return (available); + return available; } static void