diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-24 16:51:51 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-24 17:00:39 +0400 |
commit | 15a0fb58a3294876c23989915a4a6202411be1b0 (patch) | |
tree | 06270e6af9c4d446b75a573b39161664e60c6a13 /libavutil | |
parent | bec180e1127f6753b5af1e6e5242020e0de12366 (diff) | |
parent | 01cb4c84f54a52725c9b4b4dd6c609c36cccc5d4 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
utvideodec: Fix single symbol mode decoding
truespeech: drop useless casts
libavcodec: drop bogus dependencies from mpc[78] and qdm2
mpegaudio: move ff_mpa_enwindow to a separate file
AVOptions: store defaults for INT64 options in int64 union member.
Conflicts:
libavcodec/Makefile
libavfilter/af_asyncts.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/opt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index fa1d1227a6..d169b63bc3 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -163,6 +163,9 @@ static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **d return 0; } +#define DEFAULT_NUMVAL(opt) ((opt->type == AV_OPT_TYPE_INT64) ? \ + opt->default_val.i64 : opt->default_val.dbl) + static int set_string_number(void *obj, const AVOption *o, const char *val, void *dst) { int ret = 0, notfirst = 0; @@ -183,8 +186,8 @@ static int set_string_number(void *obj, const AVOption *o, const char *val, void { const AVOption *o_named = av_opt_find(obj, buf, o->unit, 0, 0); if (o_named && o_named->type == AV_OPT_TYPE_CONST) - d = o_named->default_val.dbl; - else if (!strcmp(buf, "default")) d = o->default_val.dbl; + d = DEFAULT_NUMVAL(o_named); + else if (!strcmp(buf, "default")) d = DEFAULT_NUMVAL(o); else if (!strcmp(buf, "max" )) d = o->max; else if (!strcmp(buf, "min" )) d = o->min; else if (!strcmp(buf, "none" )) d = 0; @@ -688,9 +691,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags) } break; case AV_OPT_TYPE_INT64: - 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_opt_set_int(s, opt->name, opt->default_val.dbl, 0); + av_opt_set_int(s, opt->name, opt->default_val.i64, 0); break; case AV_OPT_TYPE_DOUBLE: case AV_OPT_TYPE_FLOAT: { |