aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/f_select.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/f_select.c
parentf4596e8bb6f74599b8258c87036c237c5da4b209 (diff)
downloadffmpeg-b8a5c76131944b4cc17c6db609288d0000d56a43.tar.gz
lavfi: add frame counter into AVFilterLink and use it in filters.
Diffstat (limited to 'libavfilter/f_select.c')
-rw-r--r--libavfilter/f_select.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 0421349ff8..b0df507d00 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -283,6 +283,7 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame)
if (isnan(select->var_values[VAR_START_T]))
select->var_values[VAR_START_T] = TS2D(frame->pts) * av_q2d(inlink->time_base);
+ select->var_values[VAR_N ] = inlink->frame_count;
select->var_values[VAR_PTS] = TS2D(frame->pts);
select->var_values[VAR_T ] = TS2D(frame->pts) * av_q2d(inlink->time_base);
select->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ? NAN : av_frame_get_pkt_pos(frame);
@@ -352,7 +353,6 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame)
select->var_values[VAR_CONSUMED_SAMPLES_N] += frame->nb_samples;
}
- select->var_values[VAR_N] += 1.0;
select->var_values[VAR_PREV_PTS] = select->var_values[VAR_PTS];
select->var_values[VAR_PREV_T] = select->var_values[VAR_T];
}