[FFmpeg-cvslog] avfilter/vf_tinterlace: use frame counter from lavfi

Paul B Mahol git at videolan.org
Fri Jul 17 14:55:54 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Jul 11 13:20:02 2020 +0200| [24fea4d09b6f90df28c0cd9aaadb9a1020642837] | committer: Paul B Mahol

avfilter/vf_tinterlace: use frame counter from lavfi

Remove internal counter.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24fea4d09b6f90df28c0cd9aaadb9a1020642837
---

 libavfilter/tinterlace.h    | 1 -
 libavfilter/vf_tinterlace.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
index 020887ff34..4059ebf81a 100644
--- a/libavfilter/tinterlace.h
+++ b/libavfilter/tinterlace.h
@@ -67,7 +67,6 @@ typedef struct TInterlaceContext {
     AVRational preout_time_base;
     int flags;                  ///< flags affecting interlacing algorithm
     int lowpass;                ///< legacy interlace filter lowpass mode
-    int frame;                  ///< number of the output frame
     int vsub;                   ///< chroma vertical subsampling
     AVFrame *cur;
     AVFrame *next;
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index a77753775c..d145e35520 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -423,7 +423,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
         out->height = outlink->h;
         out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1));
 
-        field = (1 + tinterlace->frame) & 1 ? FIELD_UPPER : FIELD_LOWER;
+        field = (1 + outlink->frame_count_in) & 1 ? FIELD_UPPER : FIELD_LOWER;
         /* copy upper and lower fields */
         copy_picture_field(tinterlace, out->data, out->linesize,
                            (const uint8_t **)cur->data, cur->linesize,
@@ -517,7 +517,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
 
     out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, outlink->time_base);
     ret = ff_filter_frame(outlink, out);
-    tinterlace->frame++;
 
     return ret;
 }



More information about the ffmpeg-cvslog mailing list