summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArun Raghavan <git@arunraghavan.net>2016-05-07 13:42:34 +0530
committerArun Raghavan <arun@arunraghavan.net>2016-06-22 12:55:54 +0530
commit0985a717f30faff74657eb292aac7f73e59eb162 (patch)
tree653b8ce6fb77acaae4d3e7ff1f61b004b86d86ea /src
parent14804ba1ca4cfb58f2e8a9afa9ca87b309fa8d42 (diff)
allow-passthrough: Use pa_module_hook_connect()
Signed-off-by: Arun Raghavan <git@arunraghavan.net>
Diffstat (limited to 'src')
-rw-r--r--src/modules/module-allow-passthrough.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/modules/module-allow-passthrough.c b/src/modules/module-allow-passthrough.c
index 3b56c1ff5..4b801e469 100644
--- a/src/modules/module-allow-passthrough.c
+++ b/src/modules/module-allow-passthrough.c
@@ -51,12 +51,6 @@ struct userdata {
* its streams. */
pa_hashmap *null_sinks;
- pa_hook_slot
- *sink_input_new_slot,
- *sink_input_unlink_slot,
- *sink_input_move_start_slot,
- *sink_input_move_finish_slot;
-
bool moving;
};
@@ -281,10 +275,10 @@ int pa__init(pa_module*m) {
u->null_sinks = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
- u->sink_input_new_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_NEW], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_new_cb, u);
- u->sink_input_unlink_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_unlink_cb, u);
- u->sink_input_move_start_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_START], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_start_cb, u);
- u->sink_input_move_finish_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_FINISH], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_finish_cb, u);
+ pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_NEW], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_new_cb, u);
+ pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_UNLINK], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_unlink_cb, u);
+ pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_START], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_start_cb, u);
+ pa_module_hook_connect(m, &m->core->hooks[PA_CORE_HOOK_SINK_INPUT_MOVE_FINISH], PA_HOOK_LATE, (pa_hook_cb_t) sink_input_move_finish_cb, u);
u->moving = false;
@@ -308,15 +302,6 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata))
return;
- if (u->sink_input_new_slot)
- pa_hook_slot_free(u->sink_input_new_slot);
- if (u->sink_input_unlink_slot)
- pa_hook_slot_free(u->sink_input_unlink_slot);
- if (u->sink_input_move_start_slot)
- pa_hook_slot_free(u->sink_input_move_start_slot);
- if (u->sink_input_move_finish_slot)
- pa_hook_slot_free(u->sink_input_move_finish_slot);
-
if (m->core->state != PA_CORE_SHUTDOWN)
unload_all_null_sink_modules(u, m->core);