From: Mike Brady Date: Tue, 10 Sep 2019 08:56:25 +0000 (+0100) Subject: fix regression no volume metadata was being sent if configured to ignore volume contr... X-Git-Tag: 3.3.3~2^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b59dd4229e007eb598eaded9bfb18306719bf06b;p=thirdparty%2Fshairport-sync.git fix regression no volume metadata was being sent if configured to ignore volume control -- issue #903. --- diff --git a/player.c b/player.c index e089c31f..ba1c07a6 100644 --- a/player.c +++ b/player.c @@ -2870,20 +2870,19 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c if (config.logOutputLevel) { inform("Output Level set to: %.2f dB.", scaled_attenuation / 100.0); } - + #ifdef CONFIG_METADATA + // here, send the 'pvol' metadata message when the airplay volume information + // is being used by shairport sync to control the output volume char *dv = malloc(128); // will be freed in the metadata thread if (dv) { memset(dv, 0, 128); - if (config.ignore_volume_control == 1) - snprintf(dv, 127, "%.2f,%.2f,%.2f,%.2f", airplay_volume, 0.0, 0.0, 0.0); - else - snprintf(dv, 127, "%.2f,%.2f,%.2f,%.2f", airplay_volume, scaled_attenuation / 100.0, + snprintf(dv, 127, "%.2f,%.2f,%.2f,%.2f", airplay_volume, scaled_attenuation / 100.0, min_db / 100.0, max_db / 100.0); send_ssnc_metadata('pvol', dv, strlen(dv), 1); } #endif - // here, store the volume for possible use in the future + if (config.output->mute) config.output->mute(0); @@ -2895,6 +2894,22 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c volume_mode, airplay_volume, software_attenuation, hardware_attenuation); } } + +#ifdef CONFIG_METADATA + else { + // here, send the 'pvol' metadata message when the airplay volume information + // is not being used by shairport sync to control the output volume + char *dv = malloc(128); // will be freed in the metadata thread + if (dv) { + 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); }