]> code.delx.au - pulseaudio/blobdiff - src/modules/module-detect.c
Merge branch 'master' of git://git.0pointer.de/pulseaudio
[pulseaudio] / src / modules / module-detect.c
index 7dc2524347fb23d5f772fb9cca9123d3100c6422..1616d47c813d3fa9c11bacd6d77f0f3faa94e2f7 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of PulseAudio.
 
 
 #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>");
 
 static const char* const valid_modargs[] = {
     "just-one",
@@ -221,7 +220,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 +236,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
     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 +256,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);