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 bcce6c7a848cbbd586838f254223c4e066f1c6a7..670eed9b8c914f322064863c93c349564cbf358e 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;
       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)
   }
   if(server) {
     if(c->api == BACKEND_COMMAND && !c->speaker_command)
index a06524cb3133b8c53c28621242e7075c275d6e14..4b22fdbdf1d002985a0af913e3d615c00f41a4e6 100644 (file)
@@ -183,6 +183,8 @@ struct config {
    * BACKEND_NETWORK.
    */
   int api;
    * 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  */
 #define BACKEND_ALSA 0                 /**< Use ALSA (Linux only) */
 #define BACKEND_COMMAND 1              /**< Execute a command */
 #define BACKEND_NETWORK 2              /**< Transmit RTP  */