From 029c499bfa67b31d90c11546338a486d752a4301 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 21 Oct 2021 20:01:19 +0200 Subject: [PATCH] output/pipewire: use std::fill_n() --- src/output/plugins/PipeWireOutputPlugin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx index b665dd280..7fbd16597 100644 --- a/src/output/plugins/PipeWireOutputPlugin.cxx +++ b/src/output/plugins/PipeWireOutputPlugin.cxx @@ -53,6 +53,7 @@ #include +#include #include #include @@ -293,9 +294,7 @@ PipeWireOutput::SetVolume(float _volume) if (stream != nullptr && !restore_volume) { float vol[MAX_CHANNELS]; - - for (unsigned i = 0; i < channels; i++) - vol[i] = newvol; + std::fill_n(vol, channels, newvol); if (pw_stream_set_control(stream, SPA_PROP_channelVolumes, channels, vol,