diff options
author | Howard Chu <hyc@highlandsun.com> | 2010-04-13 22:11:21 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2010-04-13 22:11:21 +0000 |
commit | 19c9eedc2c90130697144191419556429ae7a28b (patch) | |
tree | 6c1d10be0f60c704fb9ae71627460b7de7a2ca58 | |
parent | fc122efd664ef5a13bd3dee58847b016d9ffafd4 (diff) | |
download | ffmpeg-19c9eedc2c90130697144191419556429ae7a28b.tar.gz |
Plug librtmp logging into av_log.
patch by Howard Chu, hyc highlandsun com
Originally committed as revision 22875 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/librtmp.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c index b3d78f354d..46aeaffd3a 100644 --- a/libavformat/librtmp.c +++ b/libavformat/librtmp.c @@ -29,6 +29,22 @@ #include <librtmp/rtmp.h> #include <librtmp/log.h> +static void rtmp_log(int level, const char *fmt, va_list args) +{ + switch (level) { + default: + case RTMP_LOGCRIT: level = AV_LOG_FATAL; break; + case RTMP_LOGERROR: level = AV_LOG_ERROR; break; + case RTMP_LOGWARNING: level = AV_LOG_WARNING; break; + case RTMP_LOGINFO: level = AV_LOG_INFO; break; + case RTMP_LOGDEBUG: level = AV_LOG_VERBOSE; break; + case RTMP_LOGDEBUG2: level = AV_LOG_DEBUG; break; + } + + av_vlog(NULL, level, fmt, args); + av_log(NULL, level, "\n"); +} + static int rtmp_close(URLContext *s) { RTMP *r = s->priv_data; @@ -69,6 +85,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) case AV_LOG_DEBUG: rc = RTMP_LOGDEBUG2; break; } RTMP_LogSetLevel(rc); + RTMP_LogSetCallback(rtmp_log); RTMP_Init(r); if (!RTMP_SetupURL(r, s->filename)) { |