]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Only call the volume hook once for each volume event even when the dbus interface...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 3 Oct 2022 16:56:18 +0000 (17:56 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Mon, 3 Oct 2022 16:56:18 +0000 (17:56 +0100)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index aa48d97619187723768c68981b2f7437c6a2c03a..adc9db23d8b1f4175e61d87b4274d4926f5f1060 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -3523,14 +3523,16 @@ void handle_set_parameter_parameter(rtsp_conn_info *conn, rtsp_message *req,
       debug(2, "Connection %d: request to set AirPlay Volume to: %f.", conn->connection_number,
             volume);
       // if we are playing, go ahead and change the volume
-      lock_player();
-      config.airplay_volume = volume;
-      if (playing_conn == conn)
-        player_volume(volume, conn);
-      unlock_player();
 #ifdef CONFIG_DBUS_INTERFACE
       if (dbus_service_is_running()) {
-        shairport_sync_set_volume(shairportSyncSkeleton, config.airplay_volume);
+        shairport_sync_set_volume(shairportSyncSkeleton, volume);
+      } else {
+#endif
+        lock_player();
+        if (playing_conn == conn)
+          player_volume(volume, conn);
+        unlock_player();
+#ifdef CONFIG_DBUS_INTERFACE
       }
 #endif
     } else if (strncmp(cp, "progress: ", strlen("progress: ")) ==