aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/opt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-06 14:33:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-06 14:33:38 +0100
commit15784c2bab56508565771cd04b5dda64d6717953 (patch)
treea0eade0816e7ea46a08a4cf7ffd2b25e6666c59b /libavutil/opt.c
parent32aedebdc59d5b34ab7a9137855dcc602267e00f (diff)
parent9d5c62ba5b586c80af508b5914934b1c439f6652 (diff)
downloadffmpeg-15784c2bab56508565771cd04b5dda64d6717953.tar.gz
Merge commit '9d5c62ba5b586c80af508b5914934b1c439f6652'
* commit '9d5c62ba5b586c80af508b5914934b1c439f6652': lavu/opt: do not filter out the initial sign character except for flags eval: treat dB as decibels instead of decibytes float_dsp: add vector_dmul_scalar() to multiply a vector of doubles Conflicts: libavutil/eval.c tests/ref/fate/eval Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r--libavutil/opt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index e81da47dbf..dfee6d24b8 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -184,10 +184,15 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void
double d, num = 1;
int64_t intnum = 1;
- if (*val == '+' || *val == '-')
- cmd = *(val++);
+ i = 0;
+ if (*val == '+' || *val == '-') {
+ if (o->type == AV_OPT_TYPE_FLAGS)
+ cmd = *(val++);
+ else if (!notfirst)
+ buf[i++] = *val;
+ }
- for (i = 0; i < sizeof(buf) - 1 && val[i] && val[i] != '+' && val[i] != '-'; i++)
+ for (; i < sizeof(buf) - 1 && val[i] && val[i] != '+' && val[i] != '-'; i++)
buf[i] = val[i];
buf[i] = 0;