diff options
author | liu jc <jcliu@outlook.com> | 2016-08-24 10:46:41 +0000 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-11-05 18:48:00 +0100 |
commit | c0f6eff6a7edaa38a9ea4865ffc2ad36539d9d48 (patch) | |
tree | 2ce8e96132195088742a7f66cb0a27c9d6dd1ab6 | |
parent | 7746103227195b4d106ce6090d17dc6fd36de683 (diff) | |
download | ffmpeg-c0f6eff6a7edaa38a9ea4865ffc2ad36539d9d48.tar.gz |
avformat/tcp: workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 address can not resolve port number.
Signed-off-by: liujingchao <jcliu@outlook.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/tcp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index c1054799c4..fd10a56eff 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -122,6 +122,14 @@ static int tcp_open(URLContext *h, const char *uri, int flags) cur_ai = ai; restart: + // 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; + if (!sockaddr_v6->sin6_port){ + sockaddr_v6->sin6_port = htons(port); + } + } + fd = ff_socket(cur_ai->ai_family, cur_ai->ai_socktype, cur_ai->ai_protocol); |