after calling PA_CORE_HOOK_SINK_SET_VOLUME hook, check again whether the volume changed

This commit is contained in:
Lennart Poettering 2008-10-07 22:47:32 +02:00
parent 46f73fb953
commit 68cc2996cc

View file

@ -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;