]> git.sesse.net Git - ffmpeg/commitdiff
tcp: Fix the default timeout
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 5 Jul 2013 21:34:21 +0000 (23:34 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 5 Jul 2013 22:17:31 +0000 (00:17 +0200)
Fixes Ticket2694

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/tcp.c

index 22fc8ce1ea71766a71ae21fe255635cc466e7a1f..61b7d688a57d88f7c24521be3a879c9dbe39ff99 100644 (file)
@@ -43,7 +43,7 @@ typedef struct TCPContext {
 #define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
 {"listen", "listen on port instead of connecting", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
-{"timeout", "timeout of socket i/o operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
+{"timeout", "timeout of socket i/o operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = 5000000}, 0, INT_MAX, D|E },
 {"listen_timeout", "connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
 {NULL}
 };
@@ -66,7 +66,6 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
     int ret;
     char hostname[1024],proto[1024],path[1024];
     char portstr[10];
-    h->rw_timeout = 5000000;
 
     av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
         &port, path, sizeof(path), uri);