From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 29 Sep 2021 08:26:46 +0000 (+0100) Subject: Honour the volume_range_db with a hardware attenuator, duh. X-Git-Tag: 4.1-rc1~24^2~394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3c067d009b7d005d724a9315cf3518cd1fb55bb;p=thirdparty%2Fshairport-sync.git Honour the volume_range_db with a hardware attenuator, duh. --- diff --git a/player.c b/player.c index ac332a43..6408a006 100644 --- a/player.c +++ b/player.c @@ -2912,6 +2912,8 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c warn("The range requested is too large to accommodate -- ignored."); else sw_min_db = (sw_max_db - desired_sw_range); + } else { + hw_min_db = hw_max_db - desired_range_db; } } } else { @@ -3086,20 +3088,6 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c "is disabled.", volume_mode, airplay_volume, software_attenuation, hardware_attenuation); } - /* - } - - #ifdef CONFIG_METADATA - else { - // here, send the 'pvol' metadata message when the airplay volume information - // is being used by shairport sync to control the output volume - char dv[128]; - memset(dv, 0, 128); - snprintf(dv, 127, "%.2f,%.2f,%.2f,%.2f", airplay_volume, 0.0, 0.0, 0.0); - send_ssnc_metadata('pvol', dv, strlen(dv), 1); - } - #endif - */ // here, store the volume for possible use in the future config.airplay_volume = airplay_volume; debug_mutex_unlock(&conn->volume_control_mutex, 3);