mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-21 06:16:59 +00:00
avfilter: Make enabled/disabled state available as a field of the AVFilterContext
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c4a5499d25
commit
df9f9caba5
@ -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_N] = link->frame_count;
|
||||||
dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
|
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;
|
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
|
filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame
|
||||||
: default_filter_frame;
|
: default_filter_frame;
|
||||||
}
|
}
|
||||||
|
@ -570,6 +570,7 @@ struct AVFilterContext {
|
|||||||
char *enable_str; ///< enable expression string
|
char *enable_str; ///< enable expression string
|
||||||
void *enable; ///< parsed expression (AVExpr*)
|
void *enable; ///< parsed expression (AVExpr*)
|
||||||
double *var_values; ///< variable values for the enable expression
|
double *var_values; ///< variable values for the enable expression
|
||||||
|
int is_disabled; ///< the enabled state from the last expression evaluation
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user