You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Simplify resolve_destination in sdp.c further, now that we don't enforce IPv4 any longer
Originally committed as revision 24918 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@@ -82,7 +82,7 @@ static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
|
|||||||
static void resolve_destination(char *dest_addr, int size, char *type,
|
static void resolve_destination(char *dest_addr, int size, char *type,
|
||||||
int type_size)
|
int type_size)
|
||||||
{
|
{
|
||||||
struct addrinfo hints, *ai, *cur;
|
struct addrinfo hints, *ai;
|
||||||
|
|
||||||
av_strlcpy(type, "IP4", type_size);
|
av_strlcpy(type, "IP4", type_size);
|
||||||
if (!dest_addr[0])
|
if (!dest_addr[0])
|
||||||
@@ -94,13 +94,10 @@ static void resolve_destination(char *dest_addr, int size, char *type,
|
|||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
if (getaddrinfo(dest_addr, NULL, &hints, &ai))
|
if (getaddrinfo(dest_addr, NULL, &hints, &ai))
|
||||||
return;
|
return;
|
||||||
for (cur = ai; cur; cur = cur->ai_next) {
|
getnameinfo(ai->ai_addr, ai->ai_addrlen, dest_addr, size,
|
||||||
getnameinfo(cur->ai_addr, cur->ai_addrlen, dest_addr, size,
|
|
||||||
NULL, 0, NI_NUMERICHOST);
|
NULL, 0, NI_NUMERICHOST);
|
||||||
if (cur->ai_family == AF_INET6)
|
if (ai->ai_family == AF_INET6)
|
||||||
av_strlcpy(type, "IP6", type_size);
|
av_strlcpy(type, "IP6", type_size);
|
||||||
break;
|
|
||||||
}
|
|
||||||
freeaddrinfo(ai);
|
freeaddrinfo(ai);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user