]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
use av_log_get/set_level()
authormru <mru@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 12 Dec 2007 21:48:50 +0000 (21:48 +0000)
committermru <mru@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 12 Dec 2007 21:48:50 +0000 (21:48 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11209 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffmpeg.c
ffplay.c
libavcodec/utils.c
libavutil/log.c
libavutil/log.h

index 7a8dcac3854e4d0e19198baa6b79b4815e704a5c..9712a31fb167ad3682c61cd82090306027354ac4 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2169,7 +2169,7 @@ static int opt_default(const char *opt, const char *arg){
 #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 *arg)
 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)
index c017ff8b5b78c48954241dc72d0f6fc59d3eee12..288df2d41b4ba699c5ba4c200068ee5d7c207fc7 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -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);
 }
 
index fdfa7bd4e49994aad206066a89fd01d7fe67ba25..290814dccaa60bd3529b705c6fdacde4d6207776 100644 (file)
@@ -1139,7 +1139,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
                      " [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",
index 4fd503d0dee9ebfdcdfb4ec060c93d7df200c996..fed0ce80a0ac37806dbfa98dccf042da80ce4dcb 100644 (file)
@@ -45,11 +45,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
     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 char *fmt, ...)
     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)(void*, int, const char*, va_list))
 {
     av_log_callback = callback;
 }
-#endif
index 243037239d447e1e33ae05ba1863d9c403c9c047..5d18197efb5a805a315b6e6e28d78f13e6667dac 100644 (file)
@@ -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, const char *fmt, ...) __attribute__ ((__for
 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 */