[FFmpeg-cvslog] avfilter: Make enabled/ disabled state available as a field of the AVFilterContext

Michael Niedermayer git at videolan.org
Thu May 9 00:03:52 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed May  8 21:58:40 2013 +0200| [df9f9caba58aeac461abb1232b46adbd93df7ed2] | committer: Michael Niedermayer

avfilter: Make enabled/disabled state available as a field of the AVFilterContext

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df9f9caba58aeac461abb1232b46adbd93df7ed2
---

 libavfilter/avfilter.c |    4 +++-
 libavfilter/avfilter.h |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 06d92b2..2dffcca 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -993,7 +993,9 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
         dstctx->var_values[VAR_N] = link->frame_count;
         dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
         dstctx->var_values[VAR_POS] = pos == -1 ? NAN : pos;
-        if (!av_expr_eval(dstctx->enable, dstctx->var_values, NULL))
+
+        dstctx->is_disabled = !av_expr_eval(dstctx->enable, dstctx->var_values, NULL);
+        if (dstctx->is_disabled)
             filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame
                                                          : default_filter_frame;
     }
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index e7e979e..9314335 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -570,6 +570,7 @@ struct AVFilterContext {
     char *enable_str;               ///< enable expression string
     void *enable;                   ///< parsed expression (AVExpr*)
     double *var_values;             ///< variable values for the enable expression
+    int is_disabled;                ///< the enabled state from the last expression evaluation
 };
 
 /**



More information about the ffmpeg-cvslog mailing list