diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-22 17:33:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-22 17:38:06 +0200 |
commit | 539e72727f12f7d251cd887d4f08c8eabb8746f8 (patch) | |
tree | fb2c0e5dece05b7d28ec5faa39628931ccbdce26 /libavutil/opt.c | |
parent | 4852a88dfbda7673793500e6fae645c72e618b5c (diff) | |
download | ffmpeg-539e72727f12f7d251cd887d4f08c8eabb8746f8.tar.gz |
avutil/opt: simplify set_string_number()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 08f6f1517f..693e846cdd 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -239,7 +239,7 @@ static int set_string_number(void *obj, void *target_obj, const AVOption *o, con const_names [ci] = NULL; 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); if (res < 0) { 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) return ret; val += i; - if (o->type != AV_OPT_TYPE_FLAGS || !*val) + if (!i || !*val) return 0; } |