[Ffmpeg-devel] [PATCH] Use ff_eval for AVOption parsing

Panagiotis Issaris takis.issaris
Sun Sep 24 15:20:06 CEST 2006


Hi,

On zo, 2006-09-24 at 14:53 +0200, Michael Niedermayer wrote:
>[...]
> 
> somehow i think that solving this by changeing the log level is not perfect
> but then iam not sure how else to solve it ...
Me neither...

> maybe simply returning the error message in an parameter to ff_eval() would
> be en option?
I do not really think that would be the correct solution either. If we
allow "default", "min", "max", "simple" and other to be evaluated by
ff_eval, we should not report them as errors imho. Not by av_logging an
error and not by returning an error. I think the issue lies elsewhere.

In fact, I think the correct solution would in fact be to treat anything
not being a true expression as an error, but parse for "default", "min"
and "max" _before_ letting ff_eval loose one string. But then there's
another issue, being that -dct simple, also results in simple being
parsed (and ff_eval()uated).

So, I'm not sure yet how to handle this correctly...

> maybe something like
> 
> ff_eval2(..., char **error);
> #if LIBAVCODEC_VERSION < ...
> attribute_deprecated ff_eval(eq, ...){
>     char *error=NULL;
>     double ret=ff_eval2(eq, ..., &error);
>     if(error) av_log(..., error, eq);
>     return ret;
> }
> #endif
> 
> [...]

With friendly regards,
Takis





More information about the ffmpeg-devel mailing list