From: James Berry Date: Mon, 28 Nov 2011 19:09:35 +0000 (-0500) Subject: bugfix: all vpxenc arguments were not parsed under all conditions X-Git-Tag: v1.0.0~66^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16e101ba547fe7698c16d2ff1f896b7cb2069e96;p=libvpx bugfix: all vpxenc arguments were not parsed under all conditions dynamicly assign ARG_CTRL_CNT_MAX and add check to make sure argument instance doesnt already exist before creating a duplicate Change-Id: I4f78a9c5346cda8e812cd89c077afe8996493508 --- diff --git a/vpxenc.c b/vpxenc.c index e8bd86daf..2e14f247c 100644 --- a/vpxenc.c +++ b/vpxenc.c @@ -1442,7 +1442,8 @@ static void show_rate_histogram(struct rate_hist *hist, show_histogram(hist->bucket, buckets, hist->total, scale); } -#define ARG_CTRL_CNT_MAX 10 +#define NELEMENTS(x) (sizeof(x)/sizeof(x[0])) +#define ARG_CTRL_CNT_MAX NELEMENTS(vp8_arg_ctrl_map) int main(int argc, const char **argv_) { @@ -1721,14 +1722,26 @@ int main(int argc, const char **argv_) { if (arg_match(&arg, ctrl_args[i], argi)) { + int j; match = 1; - if (arg_ctrl_cnt < ARG_CTRL_CNT_MAX) + /* Point either to the next free element or the first + * instance of this control. + */ + for(j=0; j