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-sine.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-sine.c')
-rw-r--r-- | src/modules/module-sine.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/modules/module-sine.c b/src/modules/module-sine.c index 797ba440..f2830ff0 100644 --- a/src/modules/module-sine.c +++ b/src/modules/module-sine.c @@ -114,7 +114,7 @@ static void calc_sine(float *f, size_t l, float freq) { f[i] = (float) sin((double) i/l*M_PI*2*freq)/2; } -int pa__init(pa_core *c, pa_module*m) { +int pa__init(pa_module*m) { pa_modargs *ma = NULL; struct userdata *u; pa_sink *sink; @@ -130,13 +130,13 @@ int pa__init(pa_core *c, pa_module*m) { } m->userdata = u = pa_xnew0(struct userdata, 1); - u->core = c; + u->core = m->core; u->module = m; u->sink_input = NULL; u->memblock = NULL; u->peek_index = 0; - if (!(sink = pa_namereg_get(c, pa_modargs_get_value(ma, "sink", NULL), PA_NAMEREG_SINK, 1))) { + if (!(sink = pa_namereg_get(m->core, pa_modargs_get_value(ma, "sink", NULL), PA_NAMEREG_SINK, 1))) { pa_log("No such sink."); goto fail; } @@ -151,7 +151,7 @@ int pa__init(pa_core *c, pa_module*m) { goto fail; } - u->memblock = pa_memblock_new(c->mempool, pa_bytes_per_second(&ss)); + u->memblock = pa_memblock_new(m->core->mempool, pa_bytes_per_second(&ss)); p = pa_memblock_acquire(u->memblock); calc_sine(p, pa_memblock_get_length(u->memblock), frequency); pa_memblock_release(u->memblock); @@ -165,7 +165,7 @@ int pa__init(pa_core *c, pa_module*m) { pa_sink_input_new_data_set_sample_spec(&data, &ss); data.module = m; - if (!(u->sink_input = pa_sink_input_new(c, &data, 0))) + if (!(u->sink_input = pa_sink_input_new(m->core, &data, 0))) goto fail; u->sink_input->peek = sink_input_peek_cb; @@ -182,14 +182,13 @@ fail: if (ma) pa_modargs_free(ma); - pa__done(c, m); + pa__done(m); 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)) |