Commit e997bf8e authored by diego's avatar diego

Plug librtmp logging into av_log.

patch by Howard Chu, hyc highlandsun com 


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22875 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e654b653
...@@ -29,6 +29,22 @@ ...@@ -29,6 +29,22 @@
#include <librtmp/rtmp.h> #include <librtmp/rtmp.h>
#include <librtmp/log.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) static int rtmp_close(URLContext *s)
{ {
RTMP *r = s->priv_data; RTMP *r = s->priv_data;
...@@ -69,6 +85,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) ...@@ -69,6 +85,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
case AV_LOG_DEBUG: rc = RTMP_LOGDEBUG2; break; case AV_LOG_DEBUG: rc = RTMP_LOGDEBUG2; break;
} }
RTMP_LogSetLevel(rc); RTMP_LogSetLevel(rc);
RTMP_LogSetCallback(rtmp_log);
RTMP_Init(r); RTMP_Init(r);
if (!RTMP_SetupURL(r, s->filename)) { if (!RTMP_SetupURL(r, s->filename)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment