1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-04-02 20:35:37 +02:00

avoptions: Support getting flag values using av_get_int

This commit is contained in:
Martin Storsjö 2011-05-20 14:59:47 +03:00 committed by Michael Niedermayer
parent 1b30e4f586
commit 0eed5016a2

View File

@ -261,7 +261,7 @@ static int av_get_number(void *obj, const char *name, const AVOption **o_out, do
{ {
const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); const AVOption *o= av_find_opt(obj, name, NULL, 0, 0);
void *dst; void *dst;
if (!o || o->offset<=0) if (!o || (o->offset<=0 && o->type != FF_OPT_TYPE_CONST))
goto error; goto error;
dst= ((uint8_t*)obj) + o->offset; dst= ((uint8_t*)obj) + o->offset;
@ -277,6 +277,7 @@ static int av_get_number(void *obj, const char *name, const AVOption **o_out, do
case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num; case FF_OPT_TYPE_RATIONAL: *intnum= ((AVRational*)dst)->num;
*den = ((AVRational*)dst)->den; *den = ((AVRational*)dst)->den;
return 0; return 0;
case FF_OPT_TYPE_CONST: *intnum= o->default_val.dbl;return 0;
} }
error: error:
*den=*intnum=0; *den=*intnum=0;