Commit 9d5c62ba authored by Justin Ruggles's avatar Justin Ruggles

lavu/opt: do not filter out the initial sign character except for flags

This allows parsing of special-case negative numbers like decibels.
parent 5312268b
......@@ -154,10 +154,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;
......
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