diff options
author | Nicolas George <george@nsup.org> | 2016-08-30 15:28:41 +0200 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2016-11-13 10:41:16 +0100 |
commit | 183ce55b0de0a597b838d08bbac67f54c27ed42f (patch) | |
tree | ffd40aaf4f522d18b6b87b35e1b49f276cff913d /libavfilter/vf_fieldmatch.c | |
parent | 22aa649c13b452f11353958a51f073f5fbc3bcaa (diff) | |
download | ffmpeg-183ce55b0de0a597b838d08bbac67f54c27ed42f.tar.gz |
lavfi: split frame_count between input and output.
AVFilterLink.frame_count is supposed to count the number of frames
that were passed on the link, but with min_samples, that number is
not always the same for the source and destination filters.
With the addition of a FIFO on the link, the difference will become
more significant.
Split the variable in two: frame_count_in counts the number of
frames that entered the link, frame_count_out counts the number
of frames that were sent to the destination filter.
Diffstat (limited to 'libavfilter/vf_fieldmatch.c')
-rw-r--r-- | libavfilter/vf_fieldmatch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c index e155712caa..54a2c7aa60 100644 --- a/libavfilter/vf_fieldmatch.c +++ b/libavfilter/vf_fieldmatch.c @@ -740,7 +740,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) /* scene change check */ if (fm->combmatch == COMBMATCH_SC) { - if (fm->lastn == outlink->frame_count - 1) { + if (fm->lastn == outlink->frame_count_in - 1) { if (fm->lastscdiff > fm->scthresh) sc = 1; } else if (luma_abs_diff(fm->prv, fm->src) > fm->scthresh) { @@ -748,7 +748,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } if (!sc) { - fm->lastn = outlink->frame_count; + fm->lastn = outlink->frame_count_in; fm->lastscdiff = luma_abs_diff(fm->src, fm->nxt); sc = fm->lastscdiff > fm->scthresh; } @@ -807,7 +807,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) dst->interlaced_frame = combs[match] >= fm->combpel; if (dst->interlaced_frame) { av_log(ctx, AV_LOG_WARNING, "Frame #%"PRId64" at %s is still interlaced\n", - outlink->frame_count, av_ts2timestr(in->pts, &inlink->time_base)); + outlink->frame_count_in, av_ts2timestr(in->pts, &inlink->time_base)); dst->top_field_first = field; } |