Skip to content

Commit

Permalink
cmdutils: implement debug/fdebug log level update differently.
Browse files Browse the repository at this point in the history
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
michaelni committed Dec 20, 2012
1 parent af4b1c0 commit ba4bcb1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 3 additions & 6 deletions cmdutils.c
Expand Up @@ -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 *cc = avcodec_get_class(), *fc = avformat_get_class();
const AVClass *sc, *swr_class; const AVClass *sc, *swr_class;


if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
av_log_set_level(AV_LOG_DEBUG);

if (!(p = strchr(opt, ':'))) if (!(p = strchr(opt, ':')))
p = opt + strlen(opt); p = opt + strlen(opt);
av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1)); av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
Expand Down Expand Up @@ -909,12 +912,6 @@ int opt_cpuflags(void *optctx, const char *opt, const char *arg)
return 0; 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) int opt_timelimit(void *optctx, const char *opt, const char *arg)
{ {
#if HAVE_SETRLIMIT #if HAVE_SETRLIMIT
Expand Down
2 changes: 0 additions & 2 deletions cmdutils_common_opts.h
Expand Up @@ -16,8 +16,6 @@
{ "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" }, { "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" }, { "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" },
{ "v", 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" }, { "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" }, { "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" }, { "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" },

0 comments on commit ba4bcb1

Please sign in to comment.