[FFmpeg-devel] [PATCH] tools: add ffeval tool

Stefano Sabatini stefasab at gmail.com
Tue Jan 17 12:19:19 CET 2012


On date Monday 2012-01-16 00:26:56 +0100, Michael Niedermayer encoded:
> On Sun, Jan 15, 2012 at 11:12:02PM +0100, Stefano Sabatini wrote:
> > The tool is useful for testing the internal arithmetic evaluation engine
> > (indeed I plan to use it in FATE), and provides an handy calculator when
> > you can't rely on bc ;-).
> 
> [...]
> 
> > +    while ((c = fgetc(infile)) != EOF) {
> > +        if (c == '\n') {
> > +            double d;
> > +
> > +            buf[count] = 0;
> > +            if (buf[0] != '#') {
> > +                av_expr_parse_and_eval(&d, buf,
> > +                                       NULL, NULL,
> > +                                       NULL, NULL, NULL, NULL, NULL, 0, NULL);
> > +                if (echo)
> > +                    fprintf(outfile, "%s ", buf);
> > +                fprintf(outfile, "%s%f\n", prompt, d);
> > +            }
> > +            count = 0;
> > +        } else {
> > +            if (count >= buf_size-1) {
> > +                buf = av_realloc_f(buf, buf_size, 2);
> > +                if (!buf) {
> > +                    av_log(NULL, AV_LOG_ERROR, "Memory allocation problem occurred\n");
> > +                    return 1;
> > +                }
> 

> this seems to be missing code to update buf_size and the 2 looks a bit
> odd
> 
> LGTM otherwise

Fixed/cleaned up this part and pushed, thanks.
-- 
FFmpeg = Freak Free Maxi Portable Ephemeral Generator


More information about the ffmpeg-devel mailing list