diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index aa8f31b853..fc422aa488 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1618,13 +1618,13 @@ redirect: ff_http_set_chunked_transfer_encoding(rtsp_hd_out, 0); } else { - /* open the tcp connexion */ - ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL); - if (url_open(&rtsp_hd, tcpname, URL_RDWR) < 0) { - err = AVERROR(EIO); - goto fail; - } - rtsp_hd_out = rtsp_hd; + /* open the tcp connexion */ + ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL); + if (url_open(&rtsp_hd, tcpname, URL_RDWR) < 0) { + err = AVERROR(EIO); + goto fail; + } + rtsp_hd_out = rtsp_hd; } rt->rtsp_hd = rtsp_hd; rt->rtsp_hd_out = rtsp_hd_out;