[FFmpeg-cvslog] r11209 - in trunk: ffmpeg.c ffplay.c libavcodec/utils.c libavutil/log.c libavutil/log.h

mru subversion
Wed Dec 12 22:48:53 CET 2007


Author: mru
Date: Wed Dec 12 22:48:50 2007
New Revision: 11209

Log:
use av_log_get/set_level()


Modified:
   trunk/ffmpeg.c
   trunk/ffplay.c
   trunk/libavcodec/utils.c
   trunk/libavutil/log.c
   trunk/libavutil/log.h

Modified: trunk/ffmpeg.c
==============================================================================
--- trunk/ffmpeg.c	(original)
+++ trunk/ffmpeg.c	Wed Dec 12 22:48:50 2007
@@ -2169,7 +2169,7 @@ static int opt_default(const char *opt, 
 #endif
 
     if(avctx_opts[0]->debug)
-        av_log_level = AV_LOG_DEBUG;
+        av_log_set_level(AV_LOG_DEBUG);
     return 0;
 }
 
@@ -2186,7 +2186,7 @@ static void opt_me_threshold(const char 
 static void opt_verbose(const char *arg)
 {
     verbose = atoi(arg);
-    av_log_level = atoi(arg);
+    av_log_set_level(atoi(arg));
 }
 
 static void opt_frame_rate(const char *arg)

Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c	(original)
+++ trunk/ffplay.c	Wed Dec 12 22:48:50 2007
@@ -2422,7 +2422,7 @@ static void opt_seek(const char *arg)
 
 static void opt_debug(const char *arg)
 {
-    av_log_level = 99;
+    av_log_set_level(99);
     debug = atoi(arg);
 }
 

Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c	(original)
+++ trunk/libavcodec/utils.c	Wed Dec 12 22:48:50 2007
@@ -1139,7 +1139,7 @@ void avcodec_string(char *buf, int buf_s
                      " [PAR %d:%d DAR %d:%d]",
                      enc->sample_aspect_ratio.num, enc->sample_aspect_ratio.den,
                      display_aspect_ratio.num, display_aspect_ratio.den);
-            if(av_log_level >= AV_LOG_DEBUG){
+            if(av_log_get_level() >= AV_LOG_DEBUG){
                 int g= ff_gcd(enc->time_base.num, enc->time_base.den);
                 snprintf(buf + strlen(buf), buf_size - strlen(buf),
                      ", %d/%d",

Modified: trunk/libavutil/log.c
==============================================================================
--- trunk/libavutil/log.c	(original)
+++ trunk/libavutil/log.c	Wed Dec 12 22:48:50 2007
@@ -45,11 +45,7 @@ void av_log_default_callback(void* ptr, 
     vfprintf(stderr, fmt, vl);
 }
 
-#if LIBAVUTIL_VERSION_INT < (50<<16)
 static void (*av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback;
-#else
-void (*av_vlog)(void*, int, const char*, va_list) = av_log_default_callback;
-#endif
 
 void av_log(void* avcl, int level, const char *fmt, ...)
 {
@@ -59,7 +55,6 @@ void av_log(void* avcl, int level, const
     va_end(vl);
 }
 
-#if LIBAVUTIL_VERSION_INT < (50<<16)
 void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
 {
     av_log_callback(avcl, level, fmt, vl);
@@ -79,4 +74,3 @@ void av_log_set_callback(void (*callback
 {
     av_log_callback = callback;
 }
-#endif

Modified: trunk/libavutil/log.h
==============================================================================
--- trunk/libavutil/log.h	(original)
+++ trunk/libavutil/log.h	Wed Dec 12 22:48:50 2007
@@ -81,7 +81,10 @@ struct AVCLASS {
  */
 #define AV_LOG_DEBUG    48
 #endif
+
+#if LIBAVUTIL_VERSION_INT < (50<<16)
 extern int av_log_level;
+#endif
 
 /**
  * Send the specified message to the log if the level is less than or equal to
@@ -103,14 +106,10 @@ extern void av_log(void*, int level, con
 extern void av_log(void*, int level, const char *fmt, ...);
 #endif
 
-#if LIBAVUTIL_VERSION_INT < (50<<16)
 extern void av_vlog(void*, int level, const char *fmt, va_list);
 extern int av_log_get_level(void);
 extern void av_log_set_level(int);
 extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));
 extern void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
-#else
-extern void (*av_vlog)(void*, int, const char*, va_list);
-#endif
 
 #endif /* FFMPEG_LOG_H */




More information about the ffmpeg-cvslog mailing list