Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cmdutils: implement debug/fdebug log level update differently.

The old implementation is no longer possibly due to limitations
of the new command line parser.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information...
commit ba4bcb191aa8b5fa66131544bf9ebf1f17ff7d9a 1 parent af4b1c0
Michael Niedermayer authored December 20, 2012
9  cmdutils.c
@@ -480,6 +480,9 @@ int opt_default(void *optctx, const char *opt, const char *arg)
480 480
     const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
481 481
     const AVClass *sc, *swr_class;
482 482
 
  483
+    if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
  484
+        av_log_set_level(AV_LOG_DEBUG);
  485
+
483 486
     if (!(p = strchr(opt, ':')))
484 487
         p = opt + strlen(opt);
485 488
     av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
@@ -909,12 +912,6 @@ int opt_cpuflags(void *optctx, const char *opt, const char *arg)
909 912
     return 0;
910 913
 }
911 914
 
912  
-int opt_codec_debug(void *optctx, const char *opt, const char *arg)
913  
-{
914  
-    av_log_set_level(AV_LOG_DEBUG);
915  
-    return opt_default(NULL, opt, arg);
916  
-}
917  
-
918 915
 int opt_timelimit(void *optctx, const char *opt, const char *arg)
919 916
 {
920 917
 #if HAVE_SETRLIMIT
2  cmdutils_common_opts.h
@@ -16,8 +16,6 @@
16 16
     { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
17 17
     { "loglevel"   , HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
18 18
     { "v",           HAS_ARG,  {.func_arg = opt_loglevel},      "set libav* logging level", "loglevel" },
19  
-    { "debug"      , HAS_ARG,  {.func_arg = opt_codec_debug},   "set debug flags", "flags" },
20  
-    { "fdebug"     , HAS_ARG,  {.func_arg = opt_codec_debug},   "set debug flags", "flags" },
21 19
     { "report"     , 0,        {(void*)opt_report}, "generate a report" },
22 20
     { "max_alloc"  , HAS_ARG,  {.func_arg = opt_max_alloc},     "set maximum size of a single allocated block", "bytes" },
23 21
     { "cpuflags"   , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },

0 notes on commit ba4bcb1

Please sign in to comment.
Something went wrong with that request. Please try again.