static int resetup_tcp(AVFormatContext *s) { RTSPState *rt = s->priv_data; char host[1024]; int port; av_url_split(NULL, 0, NULL, 0, host, sizeof(host), &port, NULL, 0, s->filename); ff_rtsp_undo_setup(s); return ff_rtsp_make_setup_request(s, host, port, RTSP_LOWER_TRANSPORT_TCP, rt->real_challenge); }
static int rtsp_write_close(AVFormatContext *s) { RTSPState *rt = s->priv_data; // If we want to send RTCP_BYE packets, these are sent by av_write_trailer. // Thus call this on all streams before doing the teardown. This is // done within ff_rtsp_undo_setup. ff_rtsp_undo_setup(s, 1); ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL); ff_rtsp_close_streams(s); ff_rtsp_close_connections(s); ff_network_close(); return 0; }