Unified · Split
| @@ -993,7 +993,9 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame) · 992 unmodified lines | |||
| 993 | dstctx->var_values[VAR_N] = link->frame_count; | 993 | dstctx->var_values[VAR_N] = link->frame_count; |
| 994 | dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base); | 994 | dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base); |
| 995 | dstctx->var_values[VAR_POS] = pos == -1 ? NAN : pos; | 995 | 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) | ||
| 997 | filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame | 999 | filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame |
| 998 | : default_filter_frame; | 1000 | : default_filter_frame; |
| 999 | } | 1001 | } |
| @@ -570,6 +570,7 @@ struct AVFilterContext { · 569 unmodified lines | |||
| 570 | char *enable_str; ///< enable expression string | 570 | char *enable_str; ///< enable expression string |
| 571 | void *enable; ///< parsed expression (AVExpr*) | 571 | void *enable; ///< parsed expression (AVExpr*) |
| 572 | double *var_values; ///< variable values for the enable expression | 572 | double *var_values; ///< variable values for the enable expression |
| 573 | int is_disabled; ///< the enabled state from the last expression evaluation | ||
| 573 | }; | 574 | }; |
| 574 | 575 | ||
| 575 | /** | 576 | /** |