You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avutil/opt: simplify set_string_number()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -239,7 +239,7 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con
|
|||||||
const_names [ci] = NULL;
|
const_names [ci] = NULL;
|
||||||
const_values[ci] = 0;
|
const_values[ci] = 0;
|
||||||
|
|
||||||
res = av_expr_parse_and_eval(&d, (o->type == AV_OPT_TYPE_FLAGS) ? buf : val, const_names,
|
res = av_expr_parse_and_eval(&d, i ? buf : val, const_names,
|
||||||
const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);
|
const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val);
|
av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val);
|
||||||
@@ -255,7 +255,7 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con
|
|||||||
if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0)
|
if ((ret = write_number(obj, o, dst, d, 1, 1)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
val += i;
|
val += i;
|
||||||
if (o->type != AV_OPT_TYPE_FLAGS || !*val)
|
if (!i || !*val)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user