aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-13 21:59:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-14 02:18:55 +0200
commitda31e537c4b55063cc978cd44c467c88435f17ed (patch)
tree0afe29c2c7f1207e8e618435483531b9d455dab7
parente91230a589fbf84ac57e7e878e05926bdb5b1ff6 (diff)
downloadffmpeg-da31e537c4b55063cc978cd44c467c88435f17ed.tar.gz
opt: handle AV_OPT_TYPE_CONST too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/opt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 7fe272dd9d..db4722b068 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -71,6 +71,7 @@ static int read_number(const AVOption *o, void *dst, double *num, int *den, int6
case AV_OPT_TYPE_RATIONAL: *intnum = ((AVRational*)dst)->num;
*den = ((AVRational*)dst)->den;
return 0;
+ case AV_OPT_TYPE_CONST: *num = o->default_val.dbl; return 0;
}
return AVERROR(EINVAL);
}
@@ -341,6 +342,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
case AV_OPT_TYPE_FLOAT: snprintf(buf, buf_len, "%f" , *(float *)dst);break;
case AV_OPT_TYPE_DOUBLE: snprintf(buf, buf_len, "%f" , *(double *)dst);break;
case AV_OPT_TYPE_RATIONAL: snprintf(buf, buf_len, "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
+ case AV_OPT_TYPE_CONST: snprintf(buf, buf_len, "%f" , o->default_val.dbl);break;
case AV_OPT_TYPE_STRING: return *(void**)dst;
case AV_OPT_TYPE_BINARY:
len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));