[FFmpeg-devel] [PATCH] lavu/eval: add ifelse function

Michael Niedermayer michaelni at gmx.at
Wed Jan 23 03:23:51 CET 2013


On Wed, Jan 23, 2013 at 12:58:15AM +0100, Stefano Sabatini wrote:
> On date Tuesday 2013-01-22 20:39:21 -0300, James Almer encoded:
> > On 22/01/13 8:03 PM, Stefano Sabatini wrote:
> > > @@ -595,6 +597,9 @@ static int verify_expr(AVExpr *e)
> > >          case e_taylor:
> > >              return verify_expr(e->param[0]) && verify_expr(e->param[1])
> > >                     && (!e->param[2] || verify_expr(e->param[2]));
> > > +        case e_ifelse:
> > > +            return verify_expr(e->param[0]) && verify_expr(e->param[1])
> > > +                   && (!e->param[2] || verify_expr(e->param[2]));
> > >          default: return verify_expr(e->param[0]) && verify_expr(e->param[1]) && !e->param[2];
> > 
> > case e_taylor:
> > case e_ifelse:
> >             return verify_expr(e->param[0]) && verify_expr(e->param[1])
> >                    && (!e->param[2] || verify_expr(e->param[2]));
> > 
> > No need to put the same return line twice.
> 
> Up, simpler/handier.
> -- 
> FFmpeg = Frenzy Fanciful Martial Peaceless Evil Gargoyle

>  doc/eval.texi       |    8 ++++++++
>  libavutil/eval.c    |   12 ++++++++++--
>  tests/ref/fate/eval |   12 ++++++++++++
>  3 files changed, 30 insertions(+), 2 deletions(-)
> e8ce1d9d34cea8ef5677b6cca66def7f59216322  0002-lavu-eval-extend-if-ifnot-functions-to-accept-a-thir.patch
> From 65ab662d77f56abc533d0de5db3acc1ee78196b3 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefasab at gmail.com>
> Date: Wed, 23 Jan 2013 00:02:36 +0100
> Subject: [PATCH] lavu/eval: extend if/ifnot functions to accept a third
>  parameter
> 
> Add support to an if/else construct, simplify logic in expressions.
> 
> TODO: bump micro
> ---
>  doc/eval.texi       |    8 ++++++++
>  libavutil/eval.c    |   12 ++++++++++--
>  tests/ref/fate/eval |   12 ++++++++++++
>  3 files changed, 30 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/eval.texi b/doc/eval.texi
> index 6c3eaef..54aeada 100644
> --- a/doc/eval.texi
> +++ b/doc/eval.texi
> @@ -151,10 +151,18 @@ Return the greatest common divisor of @var{x} and @var{y}. If both @var{x} and
>  Evaluate @var{x}, and if the result is non-zero return the result of
>  the evaluation of @var{y}, return 0 otherwise.
>  

> + at item if(x, y, z)
[...]
> + at item if(x, y, z)

typo

otherwise should be ok if it works

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130123/1ac3ebb4/attachment.asc>


More information about the ffmpeg-devel mailing list