]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_setpts.c
indeo3data: add missing config.h #include for HAVE_BIGENDIAN
[ffmpeg] / libavfilter / vf_setpts.c
index 8ce7d6af6e964f78e52e234c763f83524f493c37..f2650923d0faf80b57780a638b58ac725c14a2f7 100644 (file)
@@ -2,20 +2,20 @@
  * Copyright (c) 2010 Stefano Sabatini
  * Copyright (c) 2008 Victor Paesa
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -27,6 +27,7 @@
 /* #define DEBUG */
 
 #include "libavutil/eval.h"
+#include "libavutil/mathematics.h"
 #include "avfilter.h"
 
 static const char *var_names[] = {
@@ -69,7 +70,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     SetPTSContext *setpts = ctx->priv;
     int ret;
 
-    if ((ret = av_parse_expr(&setpts->expr, args ? args : "PTS",
+    if ((ret = av_expr_parse(&setpts->expr, args ? args : "PTS",
                              var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0) {
         av_log(ctx, AV_LOG_ERROR, "Error while parsing expression '%s'\n", args);
         return ret;
@@ -111,15 +112,15 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
     setpts->var_values[VAR_PTS       ] = TS2D(inpicref->pts);
     setpts->var_values[VAR_POS       ] = inpicref->pos == -1 ? NAN : inpicref->pos;
 
-    d = av_eval_expr(setpts->expr, setpts->var_values, NULL);
+    d = av_expr_eval(setpts->expr, setpts->var_values, NULL);
     outpicref->pts = D2TS(d);
 
 #ifdef DEBUG
     av_log(inlink->dst, AV_LOG_DEBUG,
-           "n:%"PRId64" interlaced:%d pos:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n",
+           "n:%"PRId64" interlaced:%d pos:%"PRId64" pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n",
            (int64_t)setpts->var_values[VAR_N],
            (int)setpts->var_values[VAR_INTERLACED],
-           (int)setpts->var_values[VAR_POS],
+           inpicref ->pos,
            inpicref ->pts, inpicref ->pts * av_q2d(inlink->time_base),
            outpicref->pts, outpicref->pts * av_q2d(inlink->time_base));
 #endif
@@ -133,7 +134,7 @@ static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
 static av_cold void uninit(AVFilterContext *ctx)
 {
     SetPTSContext *setpts = ctx->priv;
-    av_free_expr(setpts->expr);
+    av_expr_free(setpts->expr);
     setpts->expr = NULL;
 }