]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
fix regression no volume metadata was being sent if configured to ignore volume contr...
authorMike Brady <mikebrady@eircom.net>
Tue, 10 Sep 2019 08:56:25 +0000 (09:56 +0100)
committerMike Brady <mikebrady@eircom.net>
Tue, 10 Sep 2019 08:56:25 +0000 (09:56 +0100)
player.c

index e089c31f8e9e226864db346b2dbf5c01f01a2308..ba1c07a6e952360df2036873bf206c07eb53e0fe 100644 (file)
--- 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);
 }