]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix usage of ALSA softvol plugin 618/head
authorJörg Krause <joerg.krause@embedded.rocks>
Mon, 20 Nov 2017 16:27:43 +0000 (17:27 +0100)
committerJörg Krause <joerg.krause@embedded.rocks>
Mon, 20 Nov 2017 16:27:47 +0000 (17:27 +0100)
Somewhere in the version 3.x the softvol plugin got broken as the volume
change is not applied anymore. Turned out for the softvol plugin no
`volume()` and `parameters()` are defined.

audio_alsa.c

index 3288b85d7bd29a9bf5fb6b0f4571039c14ef8d5c..2963257687f89c977db79af1b87920c4e8e803c2 100644 (file)
@@ -395,6 +395,8 @@ static int init(int argc, char **argv) {
           debug(1, "Volume control \"%s\" has dB volume from %f to %f.", alsa_mix_ctrl,
                 (1.0 * alsa_mix_mindb) / 100.0, (1.0 * alsa_mix_maxdb) / 100.0);
           has_softvol = 1;
+          audio_alsa.volume = &volume; // insert the volume function now we know it can do dB stuff
+          audio_alsa.parameters = &parameters; // likewise the parameters stuff
         } else {
           debug(1, "Cannot get the dB range from the volume control \"%s\"", alsa_mix_ctrl);
         }