From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:28:11 +0000 (+0000) Subject: Look for DACP-ID and Active-Remote in the GET /info request, where it sometimes appea... X-Git-Tag: 4.3.4-dev~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f07107c36a3c2d278322c6c45815a8887b10c59;p=thirdparty%2Fshairport-sync.git Look for DACP-ID and Active-Remote in the GET /info request, where it sometimes appears from AirPlay from an intel Mac. --- diff --git a/rtsp.c b/rtsp.c index 3d6c5f48..6fe5ff68 100644 --- a/rtsp.c +++ b/rtsp.c @@ -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);