[FFmpeg-cvslog] lavf/network: add a ff_log_net_error function.
Jun Zhao
git at videolan.org
Sat Aug 18 12:17:31 EEST 2018
ffmpeg | branch: master | Jun Zhao <mypopydev at gmail.com> | Sat Aug 4 17:48:15 2018 +0800| [d428ef0ea58417456e4a84d1ed47c3935a6e0cfb] | committer: Jun Zhao
lavf/network: add a ff_log_net_error function.
add a ff_log_net_error function for error log.
Signed-off-by: Jun Zhao <mypopydev at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d428ef0ea58417456e4a84d1ed47c3935a6e0cfb
---
libavformat/network.c | 7 +++++++
libavformat/network.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/libavformat/network.c b/libavformat/network.c
index d5c82e9ab9..21c836a0aa 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -346,3 +346,10 @@ int ff_http_match_no_proxy(const char *no_proxy, const char *hostname)
av_free(buf);
return ret;
}
+
+void ff_log_net_error(void *ctx, int level, const char* prefix)
+{
+ char errbuf[100];
+ av_strerror(ff_neterrno(), errbuf, sizeof(errbuf));
+ av_log(ctx, level, "%s: %s\n", prefix, errbuf);
+}
diff --git a/libavformat/network.h b/libavformat/network.h
index efaa7893a4..7843b908a1 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -304,4 +304,6 @@ int ff_http_match_no_proxy(const char *no_proxy, const char *hostname);
int ff_socket(int domain, int type, int protocol);
+void ff_log_net_error(void *ctx, int level, const char* prefix);
+
#endif /* AVFORMAT_NETWORK_H */
More information about the ffmpeg-cvslog
mailing list