]> code.delx.au - pulseaudio/blobdiff - src/modules/module-detect.c
Remove the call for pa_rtpoll_install() in the Solaris module.
[pulseaudio] / src / modules / module-detect.c
index 858147e317e470bb411f481c93e94bee5da6428d..18479df37cc234b80020bbc2fa3b3d8910107b30 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of PulseAudio.
 
@@ -9,7 +7,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2 of the License,
+  by the Free Software Foundation; either version 2.1 of the License,
   or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -28,7 +26,6 @@
 #endif
 
 #include <stdio.h>
-#include <assert.h>
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
 #include <pulsecore/modargs.h>
 #include <pulsecore/log.h>
 #include <pulsecore/core-util.h>
+#include <pulsecore/macro.h>
 
 #include "module-detect-symdef.h"
 
-PA_MODULE_AUTHOR("Lennart Poettering")
-PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers")
-PA_MODULE_VERSION(PACKAGE_VERSION)
-PA_MODULE_USAGE("just-one=<boolean>")
+PA_MODULE_AUTHOR("Lennart Poettering");
+PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers");
+PA_MODULE_VERSION(PACKAGE_VERSION);
+PA_MODULE_LOAD_ONCE(TRUE);
+PA_MODULE_USAGE("just-one=<boolean>");
+PA_MODULE_DEPRECATED("Please use module-hal-detect instead of module-detect!");
 
 static const char* const valid_modargs[] = {
     "just-one",
@@ -101,7 +101,7 @@ static int detect_alsa(pa_core *c, int just_one) {
         if (subdevice != 0)
             continue;
 
-        pa_snprintf(args, sizeof(args), "device=hw:%u", device);
+        pa_snprintf(args, sizeof(args), "device_id=%u", device);
         if (!pa_module_load(c, is_sink ? "module-alsa-sink" : "module-alsa-source", args))
             continue;
 
@@ -221,7 +221,8 @@ static int detect_waveout(pa_core *c, int just_one) {
 #endif
 
 int pa__init(pa_module*m) {
-    int just_one = 0, n = 0;
+    pa_bool_t just_one = FALSE;
+    int n = 0;
     pa_modargs *ma;
 
     pa_assert(m);
@@ -236,16 +237,16 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
-#if HAVE_ALSA
+#ifdef HAVE_ALSA
     if ((n = detect_alsa(m->core, just_one)) <= 0)
 #endif
-#if HAVE_OSS
+#ifdef HAVE_OSS
     if ((n = detect_oss(m->core, just_one)) <= 0)
 #endif
-#if HAVE_SOLARIS
+#ifdef HAVE_SOLARIS
     if ((n = detect_solaris(m->core, just_one)) <= 0)
 #endif
-#if OS_IS_WIN32
+#ifdef OS_IS_WIN32
     if ((n = detect_waveout(m->core, just_one)) <= 0)
 #endif
     {
@@ -256,7 +257,7 @@ int pa__init(pa_module*m) {
     pa_log_info("loaded %i modules.", n);
 
     /* We were successful and can unload ourselves now. */
-    pa_module_unload_request(m);
+    pa_module_unload_request(m, TRUE);
 
     pa_modargs_free(ma);