From 7b45d01462e30d5669055b0cf0c12b38d17d5237 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Jul 2022 17:32:16 +0200 Subject: [PATCH] output/PipeWire: update field "volume" --- src/output/plugins/PipeWireOutputPlugin.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index b60e12d53..601f6585b 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -226,10 +226,10 @@ private: float sum = std::accumulate(control->values, control->values + control->n_values, 0.0f); - sum /= control->n_values; + volume = std::cbrt(sum / control->n_values); if (mixer != nullptr) - pipewire_mixer_on_change(*mixer, std::cbrt(sum)); + pipewire_mixer_on_change(*mixer, volume); pw_thread_loop_signal(thread_loop, false); }