]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Move the release of the group UUID to when the connection ends, not when the play...
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 2 Sep 2021 11:20:53 +0000 (12:20 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 2 Sep 2021 11:20:53 +0000 (12:20 +0100)
player.c
rtsp.c

index a61dc8419922a9c4ea3aba354a3bd8eb5821aed6..ac332a4366d955fdfc363812fae094fc833b87e1 100644 (file)
--- a/player.c
+++ b/player.c
@@ -1705,11 +1705,6 @@ void player_thread_cleanup_handler(void *arg) {
   if (conn->stream.type == ast_apple_lossless)
     terminate_decoders(conn);
 
-  if (conn->airplay_gid) {
-    free(conn->airplay_gid);
-    conn->airplay_gid = NULL;
-  }
-
   reset_anchor_info(conn);
   release_play_lock(conn);
   conn->rtp_running = 0;
diff --git a/rtsp.c b/rtsp.c
index 4ffe4fb2cba23a392e31e344aa463071a91b6b87..8737a2da73fcd9b1ae04004ca0556408b7bea68a 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -2267,6 +2267,7 @@ void handle_teardown_2(rtsp_conn_info *conn, __attribute__((unused)) rtsp_messag
       conn->groupContainsGroupLeader = 0;
       config.airplay_statusflags &= (0xffffffff - (1 << 11)); // DeviceSupportsRelay
       build_bonjour_strings(conn);
+      debug(1,"Connection %d: TEARDOWN mdns_update.", conn->connection_number);
       mdns_update(NULL, secondary_txt_records);
       debug(2, "Connection %d: non-stream TEARDOWN complete", conn->connection_number);
     }
@@ -2707,6 +2708,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
     msg_add_header(resp, "Content-Type", "application/x-apple-binary-plist");
     config.airplay_statusflags |= 1 << 11; // DeviceSupportsRelay
     build_bonjour_strings(conn);
+    debug(1,"Connection %d: SETUP mdns_update.", conn->connection_number);
     mdns_update(NULL, secondary_txt_records);
   } else {
     debug(1, "SETUP on Connection %d: Unrecognised SETUP incoming message from %s",
@@ -4298,6 +4300,10 @@ void rtsp_conversation_thread_cleanup_function(void *arg) {
   pair_setup_free(conn->ap2_control_pairing.setup_ctx);
   pair_verify_free(conn->ap2_control_pairing.verify_ctx);
   pair_cipher_free(conn->ap2_control_pairing.cipher_ctx);
+  if (conn->airplay_gid) {
+    free(conn->airplay_gid);
+    conn->airplay_gid = NULL;
+  }
 #endif
 
   rtp_terminate(conn);