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/f_select.c | |
parent | f4596e8bb6f74599b8258c87036c237c5da4b209 (diff) | |
download | ffmpeg-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.c | 2 |
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]; } |