mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-28 05:40:21 -04:00
store load_once flag for module
This commit is contained in:
parent
114f290be7
commit
9bfd67f70f
2 changed files with 9 additions and 4 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue