]> git.sesse.net Git - ffmpeg/commitdiff
avformat/tcp: Put struct sockaddr_in6 under #if
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 6 Nov 2016 20:10:24 +0000 (21:10 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 6 Nov 2016 20:29:12 +0000 (21:29 +0100)
Fixes: error: dereferencing pointer to incomplete type
Tested-by: Dave Yeo <daveryeo@telus.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/tcp.c

index fd10a56eff9ace9299b404355fd6e7cdd1f2d287..25abafc5eb8577e601c91b005abae34e57a37dc2 100644 (file)
@@ -122,6 +122,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
     cur_ai = ai;
 
  restart:
+#if HAVE_STRUCT_SOCKADDR_IN6
     // workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 address can not resolve port number.
     if (cur_ai->ai_family == AF_INET6){
         struct sockaddr_in6 * sockaddr_v6 = (struct sockaddr_in6 *)cur_ai->ai_addr;
@@ -129,6 +130,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
             sockaddr_v6->sin6_port = htons(port);
         }
     }
+#endif
 
     fd = ff_socket(cur_ai->ai_family,
                    cur_ai->ai_socktype,