Commit 5c17b296 authored by Max Kellermann's avatar Max Kellermann

output/PipeWire: use std::accumulate

parent 0c54f294
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <numeric>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
...@@ -222,11 +223,9 @@ private: ...@@ -222,11 +223,9 @@ private:
} }
void ControlInfo(const struct pw_stream_control *control) noexcept { void ControlInfo(const struct pw_stream_control *control) noexcept {
float sum = 0; float sum = std::accumulate(control->values,
unsigned c; control->values + control->n_values,
for (c = 0; c < control->n_values; c++) 0.0f);
sum += control->values[c];
sum /= control->n_values; sum /= control->n_values;
if (mixer != nullptr) if (mixer != nullptr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment