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
This commit is contained in:
Lennart Poettering 2006-08-12 02:19:36 +00:00
parent 47d009afd6
commit 3aba099fc3
4 changed files with 22 additions and 1 deletions

View file

@ -225,8 +225,12 @@ void pa_source_post(pa_source*s, const pa_memchunk *chunk) {
void pa_source_set_owner(pa_source *s, pa_module *m) {
assert(s);
assert(s->ref >= 1);
if (m == s->owner)
return;
s->owner = m;
pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
}
pa_usec_t pa_source_get_latency(pa_source *s) {