]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/os_support.c
Added M701 codec_tag for mpeg2video
[ffmpeg] / libavformat / os_support.c
index d9b6c1ed6960d1be5de12cc2cb37e467d7cc9366..27863031d19aab613befbfc09422e34392e09b99 100644 (file)
@@ -22,6 +22,7 @@
 
 /* needed by inet_aton() */
 #define _SVID_SOURCE
+#define _DARWIN_C_SOURCE
 
 #include "config.h"
 #include "avformat.h"
@@ -222,41 +223,6 @@ const char *ff_gai_strerror(int ecode)
 }
 #endif
 
-/* resolve host with also IP address parsing */
-int resolve_host(struct in_addr *sin_addr, const char *hostname)
-{
-
-    if (!ff_inet_aton(hostname, sin_addr)) {
-#if HAVE_GETADDRINFO
-        struct addrinfo *ai, *cur;
-        struct addrinfo hints;
-        memset(&hints, 0, sizeof(hints));
-        hints.ai_family = AF_INET;
-        if (getaddrinfo(hostname, NULL, &hints, &ai))
-            return -1;
-        /* getaddrinfo returns a linked list of addrinfo structs.
-         * Even if we set ai_family = AF_INET above, make sure
-         * that the returned one actually is of the correct type. */
-        for (cur = ai; cur; cur = cur->ai_next) {
-            if (cur->ai_family == AF_INET) {
-                *sin_addr = ((struct sockaddr_in *)cur->ai_addr)->sin_addr;
-                freeaddrinfo(ai);
-                return 0;
-            }
-        }
-        freeaddrinfo(ai);
-        return -1;
-#else
-        struct hostent *hp;
-        hp = gethostbyname(hostname);
-        if (!hp)
-            return -1;
-        memcpy(sin_addr, hp->h_addr_list[0], sizeof(struct in_addr));
-#endif
-    }
-    return 0;
-}
-
 int ff_socket_nonblock(int socket, int enable)
 {
 #if HAVE_WINSOCK2_H