diff options
author | Martin Storsjö <martin@martin.st> | 2010-08-25 13:30:06 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-08-25 13:30:06 +0000 |
commit | 7ad526d288a2e992ed83bf98d72ccf1347cef407 (patch) | |
tree | 9bca19dc76bbd333473e10be8b7b201e1e2f2ef2 /libavformat/sdp.c | |
parent | 1272ae7e5046ba3e9dd2080faab9f873a19e3380 (diff) | |
download | ffmpeg-7ad526d288a2e992ed83bf98d72ccf1347cef407.tar.gz |
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
Diffstat (limited to 'libavformat/sdp.c')
-rw-r--r-- | libavformat/sdp.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 9c0e1a93bf..249d19ad28 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -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, 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 @@ static void resolve_destination(char *dest_addr, int size, char *type, 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 |