summaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_blackdetect.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_blackdetect.c
parentf4596e8bb6f74599b8258c87036c237c5da4b209 (diff)
downloadffmpeg-streaming-b8a5c76131944b4cc17c6db609288d0000d56a43.zip
ffmpeg-streaming-b8a5c76131944b4cc17c6db609288d0000d56a43.tar.gz
lavfi: add frame counter into AVFilterLink and use it in filters.
Diffstat (limited to 'libavfilter/vf_blackdetect.c')
-rw-r--r--libavfilter/vf_blackdetect.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index 9c9e6b4..ddbf082 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -43,7 +43,6 @@ typedef struct {
double pixel_black_th;
unsigned int pixel_black_th_i;
- unsigned int frame_count; ///< frame number
unsigned int nb_black_pixels; ///< number of black pixels counted so far
} BlackDetectContext;
@@ -149,8 +148,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
picture_black_ratio = (double)blackdetect->nb_black_pixels / (inlink->w * inlink->h);
av_log(ctx, AV_LOG_DEBUG,
- "frame:%u picture_black_ratio:%f pts:%s t:%s type:%c\n",
- blackdetect->frame_count, picture_black_ratio,
+ "frame:%"PRId64" picture_black_ratio:%f pts:%s t:%s type:%c\n",
+ inlink->frame_count, picture_black_ratio,
av_ts2str(picref->pts), av_ts2timestr(picref->pts, &inlink->time_base),
av_get_picture_type_char(picref->pict_type));
@@ -168,7 +167,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
}
blackdetect->last_picref_pts = picref->pts;
- blackdetect->frame_count++;
blackdetect->nb_black_pixels = 0;
return ff_filter_frame(inlink->dst->outputs[0], picref);
}
OpenPOWER on IntegriCloud