* drop redundant pa_core argument from module initialization functions

* make pa__done() implementations optional
* a couple of modernizations
* wrap lt_dlsym() at a single place
* allow passing of an "api" argument to the HAL module, to choose whether OSS devices or ALSA devices should be picked up
* optimize fd closing a little on linux in the forked gconf helper
* save a little memory in the xsmp module


git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1615 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2007-08-10 14:28:39 +00:00
parent e621071bf1
commit ffa1708070
33 changed files with 532 additions and 444 deletions

View file

@ -704,7 +704,7 @@ finish:
pa_log_debug("Thread shutting down");
}
int pa__init(pa_core *c, pa_module*m) {
int pa__init(pa_module*m) {
pa_modargs *ma = NULL;
int ret = -1;
@ -723,7 +723,6 @@ int pa__init(pa_core *c, pa_module*m) {
int namereg_fail;
int use_mmap = 1, b;
pa_assert(c);
pa_assert(m);
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
@ -731,7 +730,7 @@ int pa__init(pa_core *c, pa_module*m) {
goto fail;
}
ss = c->default_sample_spec;
ss = m->core->default_sample_spec;
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_ALSA) < 0) {
pa_log("Failed to parse sample specification and channel map");
goto fail;
@ -756,7 +755,7 @@ int pa__init(pa_core *c, pa_module*m) {
}
u = pa_xnew0(struct userdata, 1);
u->core = c;
u->core = m->core;
u->module = m;
m->userdata = u;
u->use_mmap = use_mmap;
@ -824,7 +823,7 @@ int pa__init(pa_core *c, pa_module*m) {
namereg_fail = 0;
}
u->sink = pa_sink_new(c, __FILE__, name, namereg_fail, &ss, &map);
u->sink = pa_sink_new(m->core, __FILE__, name, namereg_fail, &ss, &map);
pa_xfree(name_buf);
if (!u->sink) {
@ -881,7 +880,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->mixer_fdl = pa_alsa_fdlist_new();
if (pa_alsa_fdlist_set_mixer(u->mixer_fdl, u->mixer_handle, c->mainloop) < 0) {
if (pa_alsa_fdlist_set_mixer(u->mixer_fdl, u->mixer_handle, m->core->mainloop) < 0) {
pa_log("failed to initialise file descriptor monitoring");
goto fail;
}
@ -917,15 +916,14 @@ finish:
fail:
if (u)
pa__done(c, m);
pa__done(m);
goto finish;
}
void pa__done(pa_core *c, pa_module*m) {
void pa__done(pa_module*m) {
struct userdata *u;
pa_assert(c);
pa_assert(m);
if (!(u = m->userdata))