Commit c48f67f0 authored by Michael Niedermayer's avatar Michael Niedermayer

ff*: add -max_alloc command line option

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 5a8e9942
...@@ -510,6 +510,20 @@ int opt_report(const char *opt) ...@@ -510,6 +510,20 @@ int opt_report(const char *opt)
return 0; return 0;
} }
int opt_max_alloc(const char *opt, const char *arg)
{
char *tail;
size_t max;
max = strtol(arg, &tail, 10);
if (*tail) {
av_log(NULL, AV_LOG_FATAL, "Invalid max_alloc \"%s\".\n", arg);
exit_program(1);
}
av_max_alloc(max);
return 0;
}
int opt_codec_debug(const char *opt, const char *arg) int opt_codec_debug(const char *opt, const char *arg)
{ {
av_log_set_level(AV_LOG_DEBUG); av_log_set_level(AV_LOG_DEBUG);
......
...@@ -78,6 +78,8 @@ int opt_loglevel(const char *opt, const char *arg); ...@@ -78,6 +78,8 @@ int opt_loglevel(const char *opt, const char *arg);
int opt_report(const char *opt); int opt_report(const char *opt);
int opt_max_alloc(const char *opt, const char *arg);
int opt_codec_debug(const char *opt, const char *arg); int opt_codec_debug(const char *opt, const char *arg);
/** /**
......
...@@ -15,3 +15,4 @@ ...@@ -15,3 +15,4 @@
{ "v", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" }, { "v", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ "debug", HAS_ARG, {(void*)opt_codec_debug}, "set debug flags", "flags" }, { "debug", HAS_ARG, {(void*)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, {(void*)opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment