Commit 1ae8a107 authored by Signed-off-by: Jun Li's avatar Signed-off-by: Jun Li Committed by Steven Liu

lavf/rtsp.c: Fix stimeout option not applied on http tunnel

stimeout option is already used in tcp transport, since
http is based on tcp, pass the option to http for tunneling
case.
Reviewed-by: 's avatarSteven Liu <lq@onvideo.cn>
Signed-off-by: 's avatarJun Li <junli1026@gmail.com>
parent bbae8d08
...@@ -1744,6 +1744,9 @@ redirect: ...@@ -1744,6 +1744,9 @@ redirect:
char httpname[1024]; char httpname[1024];
char sessioncookie[17]; char sessioncookie[17];
char headers[1024]; char headers[1024];
AVDictionary *options = NULL;
av_dict_set_int(&options, "timeout", rt->stimeout, 0);
ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" : "http", auth, host, port, "%s", path); ff_url_join(httpname, sizeof(httpname), https_tunnel ? "https" : "http", auth, host, port, "%s", path);
snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x", snprintf(sessioncookie, sizeof(sessioncookie), "%08x%08x",
...@@ -1774,7 +1777,8 @@ redirect: ...@@ -1774,7 +1777,8 @@ redirect:
} }
/* complete the connection */ /* complete the connection */
if (ffurl_connect(rt->rtsp_hd, NULL)) { if (ffurl_connect(rt->rtsp_hd, &options)) {
av_dict_free(&options);
err = AVERROR(EIO); err = AVERROR(EIO);
goto fail; goto fail;
} }
...@@ -1818,10 +1822,12 @@ redirect: ...@@ -1818,10 +1822,12 @@ redirect:
ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd); ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
/* complete the connection */ /* complete the connection */
if (ffurl_connect(rt->rtsp_hd_out, NULL)) { if (ffurl_connect(rt->rtsp_hd_out, &options)) {
av_dict_free(&options);
err = AVERROR(EIO); err = AVERROR(EIO);
goto fail; goto fail;
} }
av_dict_free(&options);
} else { } else {
int ret; int ret;
/* open the tcp connection */ /* open the tcp connection */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment