diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-08-10 14:28:39 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-08-10 14:28:39 +0000 |
commit | ffa170807086e959ce7cd9b21fb0c29b104b222b (patch) | |
tree | f1361aa0b1a54e9545a1de5398cbf1cf17c4b4cb /src/modules/module-oss.c | |
parent | e621071bf1a4f82ce5eba36917e67048ac0c59ef (diff) |
* 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
Diffstat (limited to 'src/modules/module-oss.c')
-rw-r--r-- | src/modules/module-oss.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/modules/module-oss.c b/src/modules/module-oss.c index a43bdb3c..d93d8c79 100644 --- a/src/modules/module-oss.c +++ b/src/modules/module-oss.c @@ -1059,7 +1059,7 @@ finish: pa_log_debug("Thread shutting down"); } -int pa__init(pa_core *c, pa_module*m) { +int pa__init(pa_module*m) { struct audio_buf_info info; struct userdata *u = NULL; @@ -1075,7 +1075,6 @@ int pa__init(pa_core *c, pa_module*m) { const char *name; int namereg_fail; - pa_assert(c); pa_assert(m); if (!(ma = pa_modargs_new(m->argument, valid_modargs))) { @@ -1095,7 +1094,7 @@ int pa__init(pa_core *c, pa_module*m) { mode = (playback && record) ? O_RDWR : (playback ? O_WRONLY : (record ? O_RDONLY : 0)); - 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_OSS) < 0) { pa_log("Failed to parse sample specification or channel map"); goto fail; @@ -1150,7 +1149,7 @@ int pa__init(pa_core *c, pa_module*m) { pa_assert(frag_size > 0); u = pa_xnew0(struct userdata, 1); - u->core = c; + u->core = m->core; u->module = m; m->userdata = u; u->fd = fd; @@ -1206,7 +1205,7 @@ int pa__init(pa_core *c, pa_module*m) { namereg_fail = 0; } - u->source = pa_source_new(c, __FILE__, name, namereg_fail, &ss, &map); + u->source = pa_source_new(m->core, __FILE__, name, namereg_fail, &ss, &map); pa_xfree(name_buf); if (!u->source) { pa_log("Failed to create source object"); @@ -1260,7 +1259,7 @@ try_write: 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) { pa_log("Failed to create sink object"); @@ -1310,7 +1309,7 @@ go_on: fail: if (u) - pa__done(c, m); + pa__done(m); else if (fd >= 0) close(fd); @@ -1320,10 +1319,9 @@ fail: return -1; } -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)) |