From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 2 Sep 2021 11:20:53 +0000 (+0100) Subject: Move the release of the group UUID to when the connection ends, not when the play... X-Git-Tag: 4.1-dev~4^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b24380d34b9433a599db93ab6cae35bdecd0c7b1;p=thirdparty%2Fshairport-sync.git Move the release of the group UUID to when the connection ends, not when the play session ends. --- diff --git a/player.c b/player.c index a61dc841..ac332a43 100644 --- 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 4ffe4fb2..8737a2da 100644 --- 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);