chiark / gitweb /
De-dupe default backend selection
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 27 Apr 2008 10:07:30 +0000 (11:07 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 27 Apr 2008 10:07:30 +0000 (11:07 +0100)
lib/configuration.c
lib/configuration.h

index bcce6c7..670eed9 100644 (file)
@@ -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)
index a06524c..4b22fdb 100644 (file)
@@ -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  */