[pulseaudio-commits] r1195 - /trunk/src/modules/module-hal-detect.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Aug 11 09:29:48 PDT 2006


Author: lennart
Date: Fri Aug 11 18:29:46 2006
New Revision: 1195

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1195&root=pulseaudio&view=rev
Log:
remove OSS specific code from module-hal-detect if HAVE_OSS is not set. Same for ALSA

Modified:
    trunk/src/modules/module-hal-detect.c

Modified: trunk/src/modules/module-hal-detect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-hal-detect.c?rev=1195&root=pulseaudio&r1=1194&r2=1195&view=diff
==============================================================================
--- trunk/src/modules/module-hal-detect.c (original)
+++ trunk/src/modules/module-hal-detect.c Fri Aug 11 18:29:46 2006
@@ -52,20 +52,24 @@
 PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers")
 PA_MODULE_VERSION(PACKAGE_VERSION)
 
-static const char*const capabilities[] = { "alsa", "oss" };
-
 typedef enum {
+#ifdef HAVE_ALSA
     CAP_ALSA,
+#endif
+#ifdef HAVE_OSS
     CAP_OSS,
+#endif    
     CAP_MAX
 } capability_t;
 
-typedef enum {
-    ALSA_TYPE_SINK,
-    ALSA_TYPE_SOURCE,
-    ALSA_TYPE_OTHER,
-    ALSA_TYPE_MAX
-} alsa_type_t;
+static const char* const capabilities[CAP_MAX] = {
+#ifdef HAVE_ALSA
+    [CAP_ALSA] = "alsa",
+#endif
+#ifdef HAVE_OSS
+    [CAP_OSS] = "oss",
+#endif
+};
 
 struct device {
     uint32_t index;
@@ -100,6 +104,14 @@
     hal_device_free((struct device*) d);
 }
 
+#ifdef HAVE_ALSA
+typedef enum {
+    ALSA_TYPE_SINK,
+    ALSA_TYPE_SOURCE,
+    ALSA_TYPE_OTHER,
+    ALSA_TYPE_MAX
+} alsa_type_t;
+
 static alsa_type_t hal_device_get_alsa_type(LibHalContext *ctx, const char *udi,
                                             DBusError *error)
 {
@@ -160,6 +172,9 @@
     return pa_module_load(u->core, module_name, args);
 }
 
+#endif
+
+#ifdef HAVE_OSS
 static dbus_bool_t hal_device_is_oss_pcm(LibHalContext *ctx, const char *udi,
                                          DBusError *error)
 {
@@ -206,6 +221,7 @@
 
     return pa_module_load(u->core, "module-oss", args);
 }
+#endif
 
 static dbus_bool_t hal_device_add(struct userdata *u, const char *udi,
                                   DBusError *error)
@@ -214,12 +230,16 @@
     struct device *d;
 
     switch(u->capability) {
+#ifdef HAVE_ALSA
         case CAP_ALSA:
             m = hal_device_load_alsa(u, udi, error);
             break;
+#endif
+#ifdef HAVE_OSS
         case CAP_OSS:
             m = hal_device_load_oss(u, udi, error);
             break;
+#endif
         default:
             assert(FALSE); /* never reached */
             break;
@@ -475,10 +495,10 @@
                                 pa_idxset_string_compare_func);
     m->userdata = (void*) u;
 
-#if HAVE_ALSA
+#ifdef HAVE_ALSA
     if ((n = hal_device_add_all(u, CAP_ALSA)) <= 0)
 #endif
-#if HAVE_OSS
+#ifdef HAVE_OSS
     if ((n = hal_device_add_all(u, CAP_OSS)) <= 0)
 #endif
     {




More information about the pulseaudio-commits mailing list