libavformat: Make protocols pass URLContext as log context where available

Since the libavformat major bump, URLContext contains an AVClass,
making it a usable log context.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2011-04-20 11:40:29 +02:00
parent 8408e1d7d6
commit c60112f268
5 changed files with 14 additions and 14 deletions

View File

@ -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;