diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-07 05:39:56 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-08 19:45:13 +0400 |
commit | 0678c388bac79925a375594977cad3e41cd4c5bd (patch) | |
tree | d96c194413c16c57e14a066b5187cfcb5f371dca /libavformat/rtsp.c | |
parent | c6ae7f64a09e3bb7f73dbb8971c59fbd9f56fce3 (diff) |
rtsp: add option to set the socket timeout of the lower protocol.
Fixes Ticket2294
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index fcc134f06f..dc94f0f795 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -91,6 +91,7 @@ const AVOption ff_rtsp_options[] = { { "min_port", "Minimum local UDP port", OFFSET(rtp_port_min), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MIN}, 0, 65535, DEC|ENC }, { "max_port", "Maximum local UDP port", OFFSET(rtp_port_max), AV_OPT_TYPE_INT, {.i64 = RTSP_RTP_PORT_MAX}, 0, 65535, DEC|ENC }, { "timeout", "Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC }, + { "stimeout", "timeout (in micro seconds) of socket i/o operations.", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC }, RTSP_REORDERING_OPTS(), { NULL }, }; @@ -1618,7 +1619,8 @@ redirect: } } else { /* open the tcp connection */ - ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL); + ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, + "?timeout=%d", rt->stimeout); if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE, &s->interrupt_callback, NULL) < 0) { err = AVERROR(EIO); |