[FFmpeg-cvslog] cmdutils: implement debug/fdebug log level update differently.
Michael Niedermayer
git at videolan.org
Thu Dec 20 02:42:08 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 20 02:15:40 2012 +0100| [ba4bcb191aa8b5fa66131544bf9ebf1f17ff7d9a] | committer: Michael Niedermayer
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 at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba4bcb191aa8b5fa66131544bf9ebf1f17ff7d9a
---
cmdutils.c | 9 +++------
cmdutils_common_opts.h | 2 --
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/cmdutils.c b/cmdutils.c
index c1b81a1..31c6ad6 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -480,6 +480,9 @@ int opt_default(void *optctx, const char *opt, const char *arg)
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
const AVClass *sc, *swr_class;
+ if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
+ av_log_set_level(AV_LOG_DEBUG);
+
if (!(p = strchr(opt, ':')))
p = opt + strlen(opt);
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)
return 0;
}
-int opt_codec_debug(void *optctx, const char *opt, const char *arg)
-{
- av_log_set_level(AV_LOG_DEBUG);
- return opt_default(NULL, opt, arg);
-}
-
int opt_timelimit(void *optctx, const char *opt, const char *arg)
{
#if HAVE_SETRLIMIT
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
index bfd71fe..1a84564 100644
--- a/cmdutils_common_opts.h
+++ b/cmdutils_common_opts.h
@@ -16,8 +16,6 @@
{ "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
{ "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" },
{ "v", HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" },
- { "debug" , HAS_ARG, {.func_arg = opt_codec_debug}, "set debug flags", "flags" },
- { "fdebug" , HAS_ARG, {.func_arg = opt_codec_debug}, "set debug flags", "flags" },
{ "report" , 0, {(void*)opt_report}, "generate a report" },
{ "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
{ "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },
More information about the ffmpeg-cvslog
mailing list