[FFmpeg-devel] [PATCH] added expr evaluation to drawtext - fontsize

Brett Harrison brett.harrison at zyamusic.com
Wed Apr 5 01:45:19 EEST 2017


Resurrecting this patch.

On Thu, Sep 15, 2016 at 3:20 AM, Michael Niedermayer <michael at niedermayer.cc
> wrote:

> On Fri, Sep 09, 2016 at 05:26:03PM -0700, Brett Harrison wrote:
> > Here are the changes requested
> [...]
> > +static av_cold int parse_fontsize(AVFilterContext *ctx)
> > +{
> > +    DrawTextContext *s = ctx->priv;
> > +    int err;
> > +
> > +    if (s->fontsize_expr == NULL)
> > +        return AVERROR(EINVAL);
> > +
> > +    av_expr_free(s->fontsize_pexpr);
> > +    s->fontsize_pexpr = NULL;
> > +
> > +    if ((err = av_expr_parse(&s->fontsize_pexpr, s->fontsize_expr,
> var_names,
> > +                             NULL, NULL, fun2_names, fun2, 0, ctx)) < 0)
> > +        return err;
> > +
> > +    return 0;
> > +}
>
> why is av_expr_parse() not executed where the other av_expr_parse()
> are ?
>

I needed to perform av_expr_parse() during init() to resolve the default
fontsize.  init() is called before config_input() where the other
av_expr_parse() calls are.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-added-expr-evaluation-to-drawtext-fontsize.patch
Type: application/octet-stream
Size: 8706 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170404/3f164e81/attachment.obj>


More information about the ffmpeg-devel mailing list