[FFmpeg-cvslog] avformat/tcp: Put struct sockaddr_in6 under #if

Michael Niedermayer git at videolan.org
Sun Nov 6 22:31:14 EET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  6 21:10:24 2016 +0100| [c6bc823eea6a7f6aaca14ee8a141277ea285e0f3] | committer: Michael Niedermayer

avformat/tcp: Put struct sockaddr_in6 under #if

Fixes: error: dereferencing pointer to incomplete type

Tested-by: Dave Yeo <daveryeo at telus.net>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6bc823eea6a7f6aaca14ee8a141277ea285e0f3
---

 libavformat/tcp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index fd10a56..25abafc 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -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,



More information about the ffmpeg-cvslog mailing list