output/PipeWire: ignore SPA_PROP_channelVolumes if n_values==0

After connecting, PipeWire sometimes sends SPA_PROP_channelVolumes
with no values, and this led to "volume=-NaN".
This commit is contained in:
Max Kellermann 2022-07-08 18:11:00 +02:00
parent f08944253b
commit e807ed5870

View File

@ -223,6 +223,9 @@ private:
}
void OnChannelVolumes(const struct pw_stream_control &control) noexcept {
if (control.n_values < 1)
return;
float sum = std::accumulate(control.values,
control.values + control.n_values,
0.0f);