summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/sink.c')
-rw-r--r--src/pulsecore/sink.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 150e4cb9..905fe3ff 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -80,6 +80,9 @@ pa_sink* pa_sink_new(
pa_return_null_if_fail(!driver || pa_utf8_valid(driver));
pa_return_null_if_fail(name && pa_utf8_valid(name) && *name);
+ if (pa_hook_fire(&core->hook_sink_new, NULL) < 0) /* FIXME */
+ return NULL;
+
s = pa_msgobject_new(pa_sink);
if (!(name = pa_namereg_register(core, name, PA_NAMEREG_SINK, s, fail))) {
@@ -146,6 +149,8 @@ pa_sink* pa_sink_new(
pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_NEW, s->index);
+ pa_hook_fire(&core->hook_sink_new_post, s);
+
return s;
}
@@ -174,11 +179,11 @@ void pa_sink_disconnect(pa_sink* s) {
pa_assert(s);
pa_return_if_fail(s->state != PA_SINK_DISCONNECTED);
+ pa_hook_fire(&s->core->hook_sink_disconnect, s);
+
pa_namereg_unregister(s->core, s->name);
pa_idxset_remove_by_data(s->core->sinks, s, NULL);
- pa_hook_fire(&s->core->hook_sink_disconnect, s);
-
while ((i = pa_idxset_first(s->inputs, NULL))) {
pa_assert(i != j);
pa_sink_input_kill(i);
@@ -198,6 +203,8 @@ void pa_sink_disconnect(pa_sink* s) {
s->set_state = NULL;
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK | PA_SUBSCRIPTION_EVENT_REMOVE, s->index);
+
+ pa_hook_fire(&s->core->hook_sink_disconnect_post, s);
}
static void sink_free(pa_object *o) {