changeset 6408:3a89d4044e01 libavformat

Simplify resolve_destination in sdp.c further, now that we don't enforce IPv4 any longer
author mstorsjo
date Wed, 25 Aug 2010 13:30:06 +0000
parents cb173cbeaa96
children fe8fadaf5fb6
files sdp.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/sdp.c	Wed Aug 25 12:51:20 2010 +0000
+++ b/sdp.c	Wed Aug 25 13:30:06 2010 +0000
@@ -82,7 +82,7 @@
 static void resolve_destination(char *dest_addr, int size, char *type,
                                 int type_size)
 {
-    struct addrinfo hints, *ai, *cur;
+    struct addrinfo hints, *ai;
 
     av_strlcpy(type, "IP4", type_size);
     if (!dest_addr[0])
@@ -94,13 +94,10 @@
     memset(&hints, 0, sizeof(hints));
     if (getaddrinfo(dest_addr, NULL, &hints, &ai))
         return;
-    for (cur = ai; cur; cur = cur->ai_next) {
-        getnameinfo(cur->ai_addr, cur->ai_addrlen, dest_addr, size,
+        getnameinfo(ai->ai_addr, ai->ai_addrlen, dest_addr, size,
                     NULL, 0, NI_NUMERICHOST);
-        if (cur->ai_family == AF_INET6)
+        if (ai->ai_family == AF_INET6)
             av_strlcpy(type, "IP6", type_size);
-        break;
-    }
     freeaddrinfo(ai);
 }
 #else