summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorJordi Ortiz <nenjordi@gmail.com>2012-06-26 19:21:11 +0200
committerMartin Storsjö <martin@martin.st>2012-06-27 14:04:02 +0300
commit58f3e09ee4cd7fe4b757797f0828fc3549c58535 (patch)
tree90fb33f2be9252d380e301fde87e59ce53a6938c /libavformat/tcp.c
parentc29c1a1b6bade2b9118c7fa01239c622c2238656 (diff)
tcp: Set AI_PASSIVE when the socket will be used for listening
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index badc0ba935..5313195e5c 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -63,6 +63,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
snprintf(portstr, sizeof(portstr), "%d", port);
+ if (listen_socket)
+ hints.ai_flags |= AI_PASSIVE;
ret = getaddrinfo(hostname, portstr, &hints, &ai);
if (ret) {
av_log(h, AV_LOG_ERROR,