Skip to content

Commit

Permalink
Move the release of the group UUID to when the connection ends, not w…
Browse files Browse the repository at this point in the history
…hen the play session ends.
  • Loading branch information
mikebrady committed Sep 2, 2021
1 parent 6ebc251 commit b24380d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 0 additions & 5 deletions player.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b24380d

Please sign in to comment.