summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2011-12-25 17:44:36 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2011-12-25 17:55:43 (GMT)
commitc48f67f06ec3b887626b5938987d2a46bd52cf77 (patch)
treeb2669953b0daa2b02ee52586ef4d69b0e90b8d03
parent5a8e994287d8ef181c0a5eac537547d7059b4524 (diff)
downloadffmpeg-c48f67f06ec3b887626b5938987d2a46bd52cf77.zip
ffmpeg-c48f67f06ec3b887626b5938987d2a46bd52cf77.tar.gz
ffmpeg-c48f67f06ec3b887626b5938987d2a46bd52cf77.tar.bz2
ff*: add -max_alloc command line option
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--cmdutils.c14
-rw-r--r--cmdutils.h2
-rw-r--r--cmdutils_common_opts.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/cmdutils.c b/cmdutils.c
index e072d75..adf1b5f 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -510,6 +510,20 @@ int opt_report(const char *opt)
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)
{
av_log_set_level(AV_LOG_DEBUG);
diff --git a/cmdutils.h b/cmdutils.h
index a682c96..b9ea1cf 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -78,6 +78,8 @@ int opt_loglevel(const char *opt, const char *arg);
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);
/**
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
index 058f2b1..0aa6d99 100644
--- a/cmdutils_common_opts.h
+++ b/cmdutils_common_opts.h
@@ -15,3 +15,4 @@
{ "v", HAS_ARG, {(void*)opt_loglevel}, "set libav* logging level", "loglevel" },
{ "debug", HAS_ARG, {(void*)opt_codec_debug}, "set debug flags", "flags" },
{ "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" },