diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-04-30 07:43:26 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-05-10 20:22:06 +0200 |
commit | b66752790a94820c23b0ac994d6190dd9048582d (patch) | |
tree | 8eff447721f48ce5ea757b29204f23f21c18a830 /libavutil/opt.c | |
parent | b27b54de31af2ad449291514e790aacde650ded2 (diff) | |
download | ffmpeg-b66752790a94820c23b0ac994d6190dd9048582d.tar.gz |
AVOptions: make default_val a union, as proposed in AVOption2.
This breaks API and ABI.
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index f08ed8f068..57e3248a74 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -164,8 +164,8 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons { const AVOption *o_named= av_find_opt(obj, buf, o->unit, 0, 0); if (o_named && o_named->type == FF_OPT_TYPE_CONST) - d= o_named->default_val; - else if (!strcmp(buf, "default")) d= o->default_val; + d= o_named->default_val.dbl; + else if (!strcmp(buf, "default")) d= o->default_val.dbl; else if (!strcmp(buf, "max" )) d= o->max; else if (!strcmp(buf, "min" )) d= o->min; else if (!strcmp(buf, "none" )) d= 0; @@ -417,25 +417,25 @@ void av_opt_set_defaults2(void *s, int mask, int flags) case FF_OPT_TYPE_FLAGS: case FF_OPT_TYPE_INT: { int val; - val = opt->default_val; + val = opt->default_val.dbl; av_set_int(s, opt->name, val); } break; case FF_OPT_TYPE_INT64: - if ((double)(opt->default_val+0.6) == opt->default_val) + if ((double)(opt->default_val.dbl+0.6) == opt->default_val.dbl) av_log(s, AV_LOG_DEBUG, "loss of precision in default of %s\n", opt->name); - av_set_int(s, opt->name, opt->default_val); + av_set_int(s, opt->name, opt->default_val.dbl); break; case FF_OPT_TYPE_DOUBLE: case FF_OPT_TYPE_FLOAT: { double val; - val = opt->default_val; + val = opt->default_val.dbl; av_set_double(s, opt->name, val); } break; case FF_OPT_TYPE_RATIONAL: { AVRational val; - val = av_d2q(opt->default_val, INT_MAX); + val = av_d2q(opt->default_val.dbl, INT_MAX); av_set_q(s, opt->name, val); } break; |