History

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

Michael Niedermayer committed 13 years ago

Commit df9f9ca1 parent c4a54992 files · +4 −1Browse files

Unified · Split

2 files
  1. libavfilter/avfilter.c +3 −1
  2. libavfilter/avfilter.h +1 −0
libavfilter/avfilter.c+3−1
@@ -993,7 +993,9 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame) · 992 unmodified lines
993993 dstctx->var_values[VAR_N] = link->frame_count;
994994 dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
995995 dstctx->var_values[VAR_POS] = pos == -1 ? NAN : pos;
996− if (!av_expr_eval(dstctx->enable, dstctx->var_values, NULL))
996+
997+ dstctx->is_disabled = !av_expr_eval(dstctx->enable, dstctx->var_values, NULL);
998+ if (dstctx->is_disabled)
997999 filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame
9981000 : default_filter_frame;
9991001 }
libavfilter/avfilter.h+1−0
@@ -570,6 +570,7 @@ struct AVFilterContext { · 569 unmodified lines
570570 char *enable_str; ///< enable expression string
571571 void *enable; ///< parsed expression (AVExpr*)
572572 double *var_values; ///< variable values for the enable expression
573+ int is_disabled; ///< the enabled state from the last expression evaluation
573574 };
574575
575576 /**

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t