[FFmpeg-cvslog] avfilter/avf_avectorscope: set time_base to outlink

Paul B Mahol git at videolan.org
Mon Apr 18 21:23:11 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Apr 18 20:22:34 2022 +0200| [d41f85235dad4577c806381576821abe4f6ca97f] | committer: Paul B Mahol

avfilter/avf_avectorscope: set time_base to outlink

And rescale timestamps.

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

 libavfilter/avf_avectorscope.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index b873599ac7..200b2e452c 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -240,6 +240,7 @@ static int config_output(AVFilterLink *outlink)
     outlink->h = s->h;
     outlink->sample_aspect_ratio = (AVRational){1,1};
     outlink->frame_rate = s->frame_rate;
+    outlink->time_base = av_inv_q(outlink->frame_rate);
 
     s->prev_x = s->hw = s->w / 2;
     s->prev_y = s->hh = s->mode == POLAR ? s->h - 1 : s->h / 2;
@@ -273,7 +274,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
         for (i = 0; i < outlink->h; i++)
             memset(s->outpicref->data[0] + i * s->outpicref->linesize[0], 0, outlink->w * 4);
     }
-    s->outpicref->pts = insamples->pts;
+    s->outpicref->pts = av_rescale_q(insamples->pts, inlink->time_base, outlink->time_base);
 
     av_frame_make_writable(s->outpicref);
     ff_filter_execute(ctx, fade, NULL, NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));



More information about the ffmpeg-cvslog mailing list