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:
parent
f08944253b
commit
e807ed5870
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user