[FFmpeg-devel] [PATCH 1/2] eval: support 3 parameter functions.

Michael Niedermayer michaelni at gmx.at
Wed Feb 22 17:21:50 CET 2012


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavutil/eval.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libavutil/eval.c b/libavutil/eval.c
index fda0997..d1d2cec 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -145,7 +145,7 @@ struct AVExpr {
         double (*func1)(void *, double);
         double (*func2)(void *, double, double);
     } a;
-    struct AVExpr *param[2];
+    struct AVExpr *param[3];
     double *var;
 };
 
@@ -229,6 +229,7 @@ void av_expr_free(AVExpr *e)
     if (!e) return;
     av_expr_free(e->param[0]);
     av_expr_free(e->param[1]);
+    av_expr_free(e->param[2]);
     av_freep(&e->var);
     av_freep(&e);
 }
@@ -301,6 +302,10 @@ static int parse_primary(AVExpr **e, Parser *p)
         p->s++; // ","
         parse_expr(&d->param[1], p);
     }
+    if (p->s[0]== ',') {
+        p->s++; // ","
+        parse_expr(&d->param[2], p);
+    }
     if (p->s[0] != ')') {
         av_log(p, AV_LOG_ERROR, "Missing ')' or too many args in '%s'\n", s0);
         av_expr_free(d);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list