summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-08-03 18:55:42 +0200
committerLennart Poettering <lennart@poettering.net>2008-08-03 18:55:42 +0200
commit9bfd67f70f31b5b84dea5e16e7b43ab939d94f6b (patch)
treed79ed5a0a1e16bf22be8efef0111f716fd13bdb3
parent114f290be73889a92e8f0a248a3fde1fd09c2dc9 (diff)
store load_once flag for module
-rw-r--r--src/pulsecore/module.c5
-rw-r--r--src/pulsecore/module.h8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c
index e003dd7c..edd0b0a7 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.c
@@ -76,6 +76,7 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
m = pa_xnew(pa_module, 1);
m->name = pa_xstrdup(name);
m->argument = pa_xstrdup(argument);
+ m->load_once = FALSE;
if (!(m->dl = lt_dlopenext(name))) {
pa_log("Failed to open module \"%s\": %s", name, lt_dlerror());
@@ -84,7 +85,9 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) {
if ((load_once = (pa_bool_t (*)(void)) pa_load_sym(m->dl, name, PA_SYMBOL_LOAD_ONCE))) {
- if (load_once() && c->modules) {
+ m->load_once = load_once();
+
+ if (m->load_once && c->modules) {
pa_module *i;
uint32_t idx;
/* OK, the module only wants to be loaded once, let's make sure it is */
diff --git a/src/pulsecore/module.h b/src/pulsecore/module.h
index ec582f25..bb3a3f57 100644
--- a/src/pulsecore/module.h
+++ b/src/pulsecore/module.h
@@ -43,10 +43,12 @@ struct pa_module {
void *userdata;
int n_used;
- pa_bool_t auto_unload;
- time_t last_used_time;
- pa_bool_t unload_requested;
+ pa_bool_t auto_unload:1;
+ pa_bool_t load_once:1;
+ pa_bool_t unload_requested:1;
+
+ time_t last_used_time;
};
pa_module* pa_module_load(pa_core *c, const char *name, const char*argument);