From 3aba099fc3e515db5c4b1f2990c48fdb4160ff52 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 12 Aug 2006 02:19:36 +0000 Subject: clean up event generation a little: suppress unnecessary events and generate new ones on owner change git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1212 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/sink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/pulsecore/sink.c') diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index eecf89cc..d1d9785a 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -446,11 +446,16 @@ pa_usec_t pa_sink_get_latency(pa_sink *s) { void pa_sink_set_owner(pa_sink *s, pa_module *m) { assert(s); assert(s->ref >= 1); - + + if (s->owner == m) + return; + s->owner = m; if (s->monitor_source) pa_source_set_owner(s->monitor_source, m); + + pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index); } void pa_sink_set_volume(pa_sink *s, pa_mixer_t m, const pa_cvolume *volume) { -- cgit