static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPMessageHeader *h)
{
HTTPContext *rtp_c;
- char session_id[32];
rtp_c = find_rtp_session_with_url(url, h->session_id);
if (!rtp_c) {
return;
}
- av_strlcpy(session_id, rtp_c->session_id, sizeof(session_id));
-
- /* abort the session */
- close_connection(rtp_c);
-
/* now everything is OK, so we can send the connection parameters */
rtsp_reply_header(c, RTSP_STATUS_OK);
/* session ID */
- avio_printf(c->pb, "Session: %s\r\n", session_id);
+ avio_printf(c->pb, "Session: %s\r\n", rtp_c->session_id);
avio_printf(c->pb, "\r\n");
+
+ /* abort the session */
+ close_connection(rtp_c);
}