Fix deadlock when trying to join a paused Airplay player to a group (#2602)
authorMarvin Schenkel <marvinschenkel@gmail.com>
Thu, 6 Nov 2025 20:25:56 +0000 (21:25 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Nov 2025 20:25:56 +0000 (21:25 +0100)
music_assistant/providers/airplay/player.py

index 634ee59dbb0c804efa1499932aa29395eb554a65..d32080c4cef356cde464af8ec9b62d45683df92c 100644 (file)
@@ -515,6 +515,12 @@ class AirPlayPlayer(Player):
             if child_player_to_add := cast(
                 "AirPlayPlayer | None", self.mass.players.get(player_id)
             ):
+                if (
+                    child_player_to_add.playback_state == PlaybackState.PAUSED
+                    and child_player_to_add.stream
+                ):
+                    # Stop the paused stream to avoid a deadlock situation
+                    await child_player_to_add.stream.stop()
                 if (
                     child_player_to_add.stream
                     and child_player_to_add.stream.running