aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-05-30 17:37:51 +0300
committerMartin Storsjö <martin@martin.st>2012-06-01 01:56:22 +0300
commitb7c3772be855f95f0e1903daf48c4c0246d680fb (patch)
tree82472a3d87b4e3507bbcea0a1ea645184094f28c
parent641f4a885f141b8350076c9293ebd971dc984347 (diff)
downloadffmpeg-b7c3772be855f95f0e1903daf48c4c0246d680fb.tar.gz
tcp: Try enabling SO_REUSEADDR when listening
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/tcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index e249e4e830..a6eeeb0d0f 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -83,6 +83,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
if (listen_socket) {
int fd1;
+ int reuse = 1;
+ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
ret = bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
if (ret) {
ret = ff_neterrno();