From: Lennart Poettering Date: Tue, 7 Oct 2008 20:47:32 +0000 (+0200) Subject: after calling PA_CORE_HOOK_SINK_SET_VOLUME hook, check again whether the volume changed X-Git-Tag: v0.9.15-test1~333^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68cc2996cc1e0bfe53d35eafdd26ce4572a10ce9;p=platform%2Fupstream%2Fpulseaudio.git after calling PA_CORE_HOOK_SINK_SET_VOLUME hook, check again whether the volume changed --- diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c index 7e92049..d8d1f79 100644 --- a/src/pulsecore/sink.c +++ b/src/pulsecore/sink.c @@ -856,8 +856,12 @@ void pa_sink_set_volume(pa_sink *s, const pa_cvolume *volume) { changed = !pa_cvolume_equal(&data.volume, &s->volume); - if (changed && pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_SET_VOLUME], &data) < 0) - return; + if (changed) { + if (pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SINK_SET_VOLUME], &data) < 0) + return; + + changed = !pa_cvolume_equal(&data.volume, &s->volume); + } s->volume = data.volume;