From c60112f26873afafb55d24cc50a0e93ad9411373 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 20 Apr 2011 11:40:29 +0200 Subject: libavformat: Make protocols pass URLContext as log context where available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the libavformat major bump, URLContext contains an AVClass, making it a usable log context. Signed-off-by: Martin Storsjö --- libavformat/tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/tcp.c') diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 0cb3ae3262..ced103876f 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -64,7 +64,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) snprintf(portstr, sizeof(portstr), "%d", port); ret = getaddrinfo(hostname, portstr, &hints, &ai); if (ret) { - av_log(NULL, AV_LOG_ERROR, + av_log(h, AV_LOG_ERROR, "Failed to resolve hostname %s: %s\n", hostname, gai_strerror(ret)); return AVERROR(EIO); @@ -119,7 +119,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags) optlen = sizeof(ret); getsockopt (fd, SOL_SOCKET, SO_ERROR, &ret, &optlen); if (ret != 0) { - av_log(NULL, AV_LOG_ERROR, + av_log(h, AV_LOG_ERROR, "TCP connection to %s:%d failed: %s\n", hostname, port, strerror(ret)); goto fail; -- cgit v1.2.3