diff options
author | Martin Storsjö <martin@martin.st> | 2012-05-30 17:37:51 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-06-01 01:56:22 +0300 |
commit | b7c3772be855f95f0e1903daf48c4c0246d680fb (patch) | |
tree | 82472a3d87b4e3507bbcea0a1ea645184094f28c /libavformat/tcp.c | |
parent | 641f4a885f141b8350076c9293ebd971dc984347 (diff) | |
download | ffmpeg-b7c3772be855f95f0e1903daf48c4c0246d680fb.tar.gz |
tcp: Try enabling SO_REUSEADDR when listening
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r-- | libavformat/tcp.c | 2 |
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(); |