output/plugins/SndioOutputPlugin: Fix sndio volume calculation

This commit addresses issues #2226 and MusicPlayerDaemon/ncmpc#95.
MPD and sndio volume ranges being different, the formula to transform a
value from one set to the other is in the form of `(a * x + b) / c`
where:
 - a = output set max value
 - b = adjustment term
 - c = input set max value
Previous calculation formula had `b = 0`, scaling values too low and
rendering increment impossible. Having `b = out_maxval / 2` balances the
transformation, ensuring a better spread of values across the output
range.

Closes #2226
This commit is contained in:
Jzavrk
2025-03-10 13:28:02 +01:00
committed by Max Kellermann
parent 843cb1604d
commit dac2c4df9b
2 changed files with 4 additions and 2 deletions

2
NEWS
View File

@@ -1,4 +1,6 @@
ver 0.24.1 (not yet released)
* output
- sndio: fix rounding error in volume calculation
ver 0.24 (2025/03/11)
* protocol