summaryrefslogtreecommitdiffstats
path: root/libavcodec/opt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-05-19 22:55:29 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-05-19 22:55:29 +0000
commit2b65bb45b59389d25661f3b3df45daa721d8abc8 (patch)
tree014e79af6d5d93118e76b7666ffaa1d2cfa56bda /libavcodec/opt.c
parent4880cfd9522fcb0234aacc4e40f0f27729ccee40 (diff)
downloadffmpeg-streaming-2b65bb45b59389d25661f3b3df45daa721d8abc8.zip
ffmpeg-streaming-2b65bb45b59389d25661f3b3df45daa721d8abc8.tar.gz
Change eval API to take parent log context and log level offset.
this is based on stefanos work, especially all bugs are his fault ;) Originally committed as revision 23201 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/opt.c')
-rw-r--r--libavcodec/opt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/opt.c b/libavcodec/opt.c
index c32249e..24696e1 100644
--- a/libavcodec/opt.c
+++ b/libavcodec/opt.c
@@ -147,7 +147,6 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
char buf[256];
int cmd=0;
double d;
- const char *error = NULL;
if(*val == '+' || *val == '-')
cmd= *(val++);
@@ -156,8 +155,7 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
buf[i]= val[i];
buf[i]=0;
- d = ff_parse_and_eval_expr(buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, &error);
- if(isnan(d)) {
+ {
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;
@@ -167,9 +165,11 @@ int av_set_string3(void *obj, const char *name, const char *val, int alloc, cons
else if(!strcmp(buf, "none" )) d= 0;
else if(!strcmp(buf, "all" )) d= ~0;
else {
- if (error)
- av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, error);
+ d = ff_parse_and_eval_expr(buf, const_names, const_values, NULL, NULL, NULL, NULL, NULL, 0, obj);
+ if (isnan(d)){
+ av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\"\n", val);
return AVERROR(EINVAL);
+ }
}
}
if(o->type == FF_OPT_TYPE_FLAGS){
OpenPOWER on IntegriCloud