Commit c0f6eff6 authored by liu jc's avatar liu jc Committed by Michael Niedermayer

avformat/tcp: workaround for IOS9 getaddrinfo in IPv6 only network use...

avformat/tcp: workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 address can not resolve port number.
Signed-off-by: 's avatarliujingchao <jcliu@outlook.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 77461032
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment