mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
* 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:
parent
e621071bf1
commit
ffa1708070
33 changed files with 532 additions and 444 deletions
|
|
@ -66,15 +66,14 @@ static void eof_and_exit_cb(pa_cli*c, void *userdata) {
|
|||
m->core->mainloop->quit(m->core->mainloop, 0);
|
||||
}
|
||||
|
||||
int pa__init(pa_core *c, pa_module*m) {
|
||||
int pa__init(pa_module*m) {
|
||||
pa_iochannel *io;
|
||||
pa_modargs *ma;
|
||||
int exit_on_eof = 0;
|
||||
|
||||
assert(c);
|
||||
assert(m);
|
||||
|
||||
if (c->running_as_daemon) {
|
||||
if (m->core->running_as_daemon) {
|
||||
pa_log_info("Running as daemon, refusing to load this module.");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -94,12 +93,10 @@ int pa__init(pa_core *c, pa_module*m) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
io = pa_iochannel_new(c->mainloop, STDIN_FILENO, STDOUT_FILENO);
|
||||
assert(io);
|
||||
io = pa_iochannel_new(m->core->mainloop, STDIN_FILENO, STDOUT_FILENO);
|
||||
pa_iochannel_set_noclose(io, 1);
|
||||
|
||||
m->userdata = pa_cli_new(c, io, m);
|
||||
assert(m->userdata);
|
||||
m->userdata = pa_cli_new(m->core, io, m);
|
||||
|
||||
pa_cli_set_eof_callback(m->userdata, exit_on_eof ? eof_and_exit_cb : eof_and_unload_cb, m);
|
||||
|
||||
|
|
@ -115,11 +112,10 @@ fail:
|
|||
return -1;
|
||||
}
|
||||
|
||||
void pa__done(pa_core *c, pa_module*m) {
|
||||
assert(c);
|
||||
void pa__done(pa_module*m) {
|
||||
assert(m);
|
||||
|
||||
if (c->running_as_daemon == 0) {
|
||||
if (m->core->running_as_daemon == 0) {
|
||||
pa_cli_free(m->userdata);
|
||||
pa_stdio_release();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue