diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index 1ca877668a..f66b86c040 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -139,12 +139,13 @@ SndioOutput::Play(std::span src) void SndioOutput::SetVolume(unsigned int volume) { - sio_setvol(hdl, volume * SIO_MAXVOL / 100); + sio_setvol(hdl, (volume * SIO_MAXVOL + 50) / 100); } static inline unsigned int RawToPercent(int raw_volume) { - return raw_volume < 0 ? 100 : raw_volume * 100 / SIO_MAXVOL; + return raw_volume < 0 ? 100 : + (raw_volume * 100 + SIO_MAXVOL / 2) / SIO_MAXVOL; } void