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:
@ -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;
|
||||
|
Reference in New Issue
Block a user