[FFmpeg-devel] [PATCH] Use ff_eval2() in cmdutils.c:parse_number_or_die()

Stefano Sabatini stefano.sabatini-lala
Wed Aug 20 11:39:23 CEST 2008


On date Wednesday 2008-08-20 01:43:17 +0200, Michael Niedermayer encoded:
> On Mon, Aug 11, 2008 at 11:43:53PM +0200, Stefano Sabatini wrote:
[...]
> > Index: cmdutils.c
> > ===================================================================
> > --- cmdutils.c	(revision 14695)
> > +++ cmdutils.c	(working copy)
> > @@ -29,6 +29,7 @@
> >  #include "libavfilter/avfilter.h"
> >  #include "libavdevice/avdevice.h"
> >  #include "libavutil/avstring.h"
> > +#include "libavcodec/eval.h"
> >  #include "cmdutils.h"
> >  #include "version.h"
> >  #ifdef CONFIG_NETWORK
> > @@ -42,7 +43,7 @@
> >  {
> >      char *tail;
> >      const char *error;
> > -    double d = strtod(numstr, &tail);
> > +    double d = av_strtod(numstr, &tail);
> >      if (*tail)
> >          error= "Expected number for %s but found: %s\n";
> >      else if (d < min || d > max)
> 
> i wonder if it would make sense to just use the whole expression evaluator
> instead of av_strtod().
> Actually i think this would be a great idea

Check it, I'm not very happy about the duplication of const_values and
const_names which are taken from eval.c for consistency, suggestions
are welcome.

BTW what about to rename the function "parse_expr_or_die"?

Regards.
-- 
FFmpeg = Fantastic and Faboulous Magic Portable Evanescent Game
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-ff-eval-in-cmdutils-00.patch
Type: text/x-diff
Size: 1195 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080820/eb8a2d17/attachment.patch>



More information about the ffmpeg-devel mailing list