Skip to content

Commit

Permalink
Look for DACP-ID and Active-Remote in the GET /info request, where it…
Browse files Browse the repository at this point in the history
… sometimes appears from AirPlay from an intel Mac.
  • Loading branch information
mikebrady committed Mar 25, 2024
1 parent 9862793 commit 0f07107
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,47 @@ void handle_get_info(__attribute((unused)) rtsp_conn_info *conn, rtsp_message *r
hdr);
}
}

// In Stage 1, look for the DACP and Active-Remote
char *ar = msg_get_header(req, "Active-Remote");
if (ar) {
debug(3, "Connection %d: GET /info -- Active-Remote string seen: \"%s\".",
conn->connection_number, ar);
// get the active remote
if (conn->dacp_active_remote) // this is in case SETUP was previously called
free(conn->dacp_active_remote);
conn->dacp_active_remote = strdup(ar);
#ifdef CONFIG_METADATA
send_metadata('ssnc', 'acre', ar, strlen(ar), req, 1);
#endif
} else {
debug(3, "Connection %d: GET /info -- doesn't include Active-Remote information.",
conn->connection_number);
if (conn->dacp_active_remote) { // this is in case GET /info was previously called
free(conn->dacp_active_remote);
conn->dacp_active_remote = NULL;
}
}

ar = msg_get_header(req, "DACP-ID");
if (ar) {
debug(3, "Connection %d: GET /info -- DACP-ID string seen: \"%s\".", conn->connection_number,
ar);
if (conn->dacp_id) // this is in case SETUP was previously called
free(conn->dacp_id);
conn->dacp_id = strdup(ar);
#ifdef CONFIG_METADATA
send_metadata('ssnc', 'daid', ar, strlen(ar), req, 1);
#endif
} else {
debug(3, "Connection %d: GET /info -- doesn't include DACP-ID string information.",
conn->connection_number);
if (conn->dacp_id) { // this is in case GET /info was previously called
free(conn->dacp_id);
conn->dacp_id = NULL;
}
}

plist_t info_plist = NULL;
plist_from_memory(req->content, req->contentlength, &info_plist);

Expand Down

0 comments on commit 0f07107

Please sign in to comment.