summaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-24 14:51:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-24 15:00:39 +0200
commit15a0fb58a3294876c23989915a4a6202411be1b0 (patch)
tree06270e6af9c4d446b75a573b39161664e60c6a13 /libavutil
parentbec180e1127f6753b5af1e6e5242020e0de12366 (diff)
parent01cb4c84f54a52725c9b4b4dd6c609c36cccc5d4 (diff)
downloadffmpeg-streaming-15a0fb58a3294876c23989915a4a6202411be1b0.zip
ffmpeg-streaming-15a0fb58a3294876c23989915a4a6202411be1b0.tar.gz
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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index fa1d122..d169b63 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: {
OpenPOWER on IntegriCloud