]> git.sesse.net Git - ffmpeg/commitdiff
tcp: Set AI_PASSIVE when the socket will be used for listening
authorJordi Ortiz <nenjordi@gmail.com>
Tue, 26 Jun 2012 17:21:11 +0000 (19:21 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 27 Jun 2012 11:04:02 +0000 (14:04 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/tcp.c

index badc0ba9355c068d354fb419e3f3d784bf652392..5313195e5c0b7fba26606856bcb522f238efc8f4 100644 (file)
@@ -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,