On Tue, 26 Jun 2012, Jordi Ortiz wrote:

---
libavformat/tcp.c |    5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 1546446..c5677fe 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -66,7 +66,10 @@ static int tcp_open(URLContext *h, const char *uri, int 
flags)
    snprintf(portstr, sizeof(portstr), "%d", port);
    if (listen_socket)
        hints.ai_flags |= AI_PASSIVE;
-    ret = getaddrinfo(hostname, portstr, &hints, &ai);
+    if (!hostname[0])
+        ret = getaddrinfo(NULL, portstr, &hints, &ai);
+    else
+        ret = getaddrinfo(hostname, portstr, &hints, &ai);
    if (ret) {
        av_log(h, AV_LOG_ERROR,
               "Failed to resolve hostname %s: %s\n",
--
1.7.10

Both look ok to me now, will push later.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to