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

Brett Harrison brett.harrison at zyamusic.com
Sun Aug 28 02:30:05 EEST 2016


Fixed patch based on comments.

This time attaching patch file.

On Sat, Aug 27, 2016 at 6:21 AM, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Fri, Aug 26, 2016 at 14:37:42 -0700, Brett Harrison wrote:
>
> > +    if (diff != 0) {
> > +      return diff > 0 ? 1 : diff < 0 ? -1 : 0;
> > +    }
>
> If diff != 0, it can only be >0 or <0, nothing else:
>        if (diff != 0)
>          return diff > 0 ? 1 : -1;
> (And you can drop the curly brackets.)
>
> > +    else {
> > +      int64_t diff = (int64_t)a->fontsize - (int64_t)bb->fontsize;
> > +      return diff > 0 ? 1 : diff < 0 ? -1 : 0;
> > +    }
>
> There's a macro for this:
>        else
>            return FFDIFFSIGN((int64_t)a->fontsize, (int64_t)bb->fontsize);
>
> Moritz
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-added-expr-evaluation-to-drawtext-fontsize.patch
Type: application/octet-stream
Size: 7791 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160827/63cd6ed1/attachment.obj>


More information about the ffmpeg-devel mailing list