From bba21600ff72335de7bec9476585069d5ab58ed2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 4 Oct 2006 22:10:09 +0000 Subject: [PATCH] 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. --- src/audio/SDL_audio.c | 37 ------------------------------------ src/audio/esd/SDL_esdaudio.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index d5f30c062..c9cee7e59 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -370,48 +370,11 @@ SDL_AudioInit(const char *driver_name) 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 --git a/src/audio/esd/SDL_esdaudio.c b/src/audio/esd/SDL_esdaudio.c index c35eb2915..e9a8f454c 100644 --- a/src/audio/esd/SDL_esdaudio.c +++ b/src/audio/esd/SDL_esdaudio.c @@ -126,10 +126,14 @@ LoadESDLibrary(void) 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; + + if (esd_no_spawn == NULL) { + SDL_putenv("ESD_NO_SPAWN=1"); /* Don't start ESD if it's not running */ + } - available = 0; if (LoadESDLibrary() < 0) { return available; } @@ -139,7 +143,7 @@ Audio_Available(void) SDL_NAME(esd_close) (connection); } UnloadESDLibrary(); - return (available); + return available; } static void