output/pipewire: use std::fill_n()
This commit is contained in:
parent
0ba867ec16
commit
029c499bfa
@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
#include <boost/lockfree/spsc_queue.hpp>
|
#include <boost/lockfree/spsc_queue.hpp>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -293,9 +294,7 @@ PipeWireOutput::SetVolume(float _volume)
|
|||||||
|
|
||||||
if (stream != nullptr && !restore_volume) {
|
if (stream != nullptr && !restore_volume) {
|
||||||
float vol[MAX_CHANNELS];
|
float vol[MAX_CHANNELS];
|
||||||
|
std::fill_n(vol, channels, newvol);
|
||||||
for (unsigned i = 0; i < channels; i++)
|
|
||||||
vol[i] = newvol;
|
|
||||||
|
|
||||||
if (pw_stream_set_control(stream,
|
if (pw_stream_set_control(stream,
|
||||||
SPA_PROP_channelVolumes, channels, vol,
|
SPA_PROP_channelVolumes, channels, vol,
|
||||||
|
Loading…
Reference in New Issue
Block a user