aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_crop.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-04-15 17:42:04 +0200
committerClément Bœsch <ubitux@gmail.com>2013-04-23 01:02:27 +0200
commitb8a5c76131944b4cc17c6db609288d0000d56a43 (patch)
tree2aeabcf34ac5d3ada79c9ae6168dba392ab393dd /libavfilter/vf_crop.c
parentf4596e8bb6f74599b8258c87036c237c5da4b209 (diff)
downloadffmpeg-b8a5c76131944b4cc17c6db609288d0000d56a43.tar.gz
lavfi: add frame counter into AVFilterLink and use it in filters.
Diffstat (limited to 'libavfilter/vf_crop.c')
-rw-r--r--libavfilter/vf_crop.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c
index 11ed375c48..5d7dd2cc88 100644
--- a/libavfilter/vf_crop.c
+++ b/libavfilter/vf_crop.c
@@ -259,6 +259,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
frame->width = crop->w;
frame->height = crop->h;
+ crop->var_values[VAR_N] = link->frame_count;
crop->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
NAN : frame->pts * av_q2d(link->time_base);
crop->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ?
@@ -299,8 +300,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame)
frame->data[3] += crop->x * crop->max_step[3];
}
- crop->var_values[VAR_N] += 1.0;
-
return ff_filter_frame(link->dst->outputs[0], frame);
}