diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-04-15 17:42:04 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-04-23 01:02:27 +0200 |
commit | b8a5c76131944b4cc17c6db609288d0000d56a43 (patch) | |
tree | 2aeabcf34ac5d3ada79c9ae6168dba392ab393dd /libavfilter/vf_overlay.c | |
parent | f4596e8bb6f74599b8258c87036c237c5da4b209 (diff) |
lavfi: add frame counter into AVFilterLink and use it in filters.
Diffstat (limited to 'libavfilter/vf_overlay.c')
-rw-r--r-- | libavfilter/vf_overlay.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index dab6707ced..c7a204bb0e 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -600,6 +600,7 @@ static int try_filter_frame(AVFilterContext *ctx, AVFrame *mainpic) if (over->eval_mode == EVAL_MODE_FRAME) { int64_t pos = av_frame_get_pkt_pos(mainpic); + over->var_values[VAR_N] = inlink->frame_count; over->var_values[VAR_T] = mainpic->pts == AV_NOPTS_VALUE ? NAN : mainpic->pts * av_q2d(inlink->time_base); over->var_values[VAR_POS] = pos == -1 ? NAN : pos; @@ -614,7 +615,6 @@ static int try_filter_frame(AVFilterContext *ctx, AVFrame *mainpic) if (over->enable) blend_image(ctx, mainpic, over->overpicref, over->x, over->y); - over->var_values[VAR_N] += 1.0; } ret = ff_filter_frame(ctx->outputs[0], mainpic); av_assert1(ret != AVERROR(EAGAIN)); |