diff options
author | David Henningsson <david.henningsson@canonical.com> | 2015-03-27 11:20:14 +0100 |
---|---|---|
committer | David Henningsson <david.henningsson@canonical.com> | 2015-04-10 09:26:45 +0200 |
commit | 6eae0d4bf47258f3095fde13ebe179dbdc4cbcda (patch) | |
tree | e29d65e798a7a9f76aaa947a2b2746e165d3e008 | |
parent | a5ea14248739dda6b0bd75c957415cfff3068aec (diff) |
module-alsa-card: use pa_module_hook_connect
Refactoring, no functional change.
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r-- | src/modules/alsa/module-alsa-card.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c index a7fec048a..382e40d63 100644 --- a/src/modules/alsa/module-alsa-card.c +++ b/src/modules/alsa/module-alsa-card.c @@ -122,12 +122,6 @@ struct userdata { bool use_ucm; pa_alsa_ucm_config ucm; - /* hooks for modifier action */ - pa_hook_slot - *sink_input_put_hook_slot, - *source_output_put_hook_slot, - *sink_input_unlink_hook_slot, - *source_output_unlink_hook_slot; }; struct profile_data { @@ -677,16 +671,16 @@ int pa__init(pa_module *m) { /* hook start of sink input/source output to enable modifiers */ /* A little bit later than module-role-cork */ - u->sink_input_put_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], PA_HOOK_LATE+10, + pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_PUT], PA_HOOK_LATE+10, (pa_hook_cb_t) sink_input_put_hook_callback, u); - u->source_output_put_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], PA_HOOK_LATE+10, + pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_PUT], PA_HOOK_LATE+10, (pa_hook_cb_t) source_output_put_hook_callback, u); /* hook end of sink input/source output to disable modifiers */ /* A little bit later than module-role-cork */ - u->sink_input_unlink_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE+10, + pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE+10, (pa_hook_cb_t) sink_input_unlink_hook_callback, u); - u->source_output_unlink_hook_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], PA_HOOK_LATE+10, + pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_UNLINK], PA_HOOK_LATE+10, (pa_hook_cb_t) source_output_unlink_hook_callback, u); } else { @@ -820,18 +814,6 @@ void pa__done(pa_module*m) { if (!(u = m->userdata)) goto finish; - if (u->sink_input_put_hook_slot) - pa_hook_slot_free(u->sink_input_put_hook_slot); - - if (u->sink_input_unlink_hook_slot) - pa_hook_slot_free(u->sink_input_unlink_hook_slot); - - if (u->source_output_put_hook_slot) - pa_hook_slot_free(u->source_output_put_hook_slot); - - if (u->source_output_unlink_hook_slot) - pa_hook_slot_free(u->source_output_unlink_hook_slot); - if (u->mixer_fdl) pa_alsa_fdlist_free(u->mixer_fdl); if (u->mixer_handle) |