From 8aae240b86a4b055989ef631e1c8876c3d338873 Mon Sep 17 00:00:00 2001 Message-Id: <8aae240b86a4b055989ef631e1c8876c3d338873.1714171171.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 27 Apr 2008 11:07:30 +0100 Subject: [PATCH] De-dupe default backend selection Organization: Straylight/Edgeware From: Richard Kettlewell --- lib/configuration.c | 13 ++----------- lib/configuration.h | 2 ++ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/configuration.c b/lib/configuration.c index bcce6c7..670eed9 100644 --- a/lib/configuration.c +++ b/lib/configuration.c @@ -1280,17 +1280,8 @@ static void config_postdefaults(struct config *c, c->api = BACKEND_COMMAND; else if(c->broadcast.n) c->api = BACKEND_NETWORK; - else { -#if HAVE_ALSA_ASOUNDLIB_H - c->api = BACKEND_ALSA; -#elif HAVE_SYS_SOUNDCARD_H - c->api = BACKEND_OSS; -#elif HAVE_COREAUDIO_AUDIOHARDWARE_H - c->api = BACKEND_COREAUDIO; -#else - c->api = BACKEND_COMMAND; -#endif - } + else + c->api = DEFAULT_BACKEND; } if(server) { if(c->api == BACKEND_COMMAND && !c->speaker_command) diff --git a/lib/configuration.h b/lib/configuration.h index a06524c..4b22fdb 100644 --- a/lib/configuration.h +++ b/lib/configuration.h @@ -183,6 +183,8 @@ struct config { * BACKEND_NETWORK. */ int api; + +/* These values had better be non-negative */ #define BACKEND_ALSA 0 /**< Use ALSA (Linux only) */ #define BACKEND_COMMAND 1 /**< Execute a command */ #define BACKEND_NETWORK 2 /**< Transmit RTP */ -- [mdw]