2011-12-22 12:24:00 -0800, Ronald S. Bultje wrote:
>
> On Tue, Dec 20, 2011 at 5:02 PM, Janne Grunau <[email protected]> wrote:
> > Negative number of threads does not make sense and 0 is used for
> > automatic number of threads.
> > ---
> >  libavcodec/options.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
>
> OK.
>
> Can we also somehow set a label so "0" and "auto" are the same, and
> users see and understand that "0" means "auto"?

sure we can, see below.

Janne
---8<---
A negative number of threads does not make sense and 0 is used for
autodetection. Adds a symbolic name for autodetection.
---
 libavcodec/options.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index a3a102c..4ac9313 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -370,7 +370,8 @@ static const AVOption options[]={
 {"float", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, 
V|D, "aa"},
 #endif
 {"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), 
AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
-{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 1 }, INT_MIN, 
INT_MAX, V|E|D},
+{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 1 }, 0, 
INT_MAX, V|E|D, "threads"},
+{"auto", "detect a good number of threads", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, 
INT_MIN, INT_MAX, V|E|D, "threads"},
 {"me_threshold", "motion estimaton threshold", OFFSET(me_threshold), 
AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"mb_threshold", "macroblock threshold", OFFSET(mb_threshold), 
AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E},
 {"dc", "intra_dc_precision", OFFSET(intra_dc_precision), AV_OPT_TYPE_INT, 
{.dbl = 0 }, INT_MIN, INT_MAX, V|E},
--
1.7.8.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to