[FFmpeg-cvslog] avfilter/avf_showspectrum: fix pts offset by one

Paul B Mahol git at videolan.org
Thu Apr 14 23:38:47 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Apr 14 22:11:46 2022 +0200| [a34fe3dfa97bbbfd055964aaf7a6b1a3badb1f8a] | committer: Paul B Mahol

avfilter/avf_showspectrum: fix pts offset by one

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

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

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index f09d9145b4..00fca02e1b 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1064,6 +1064,7 @@ static int config_output(AVFilterLink *outlink)
     int i, fft_size, h, w, ret;
     float overlap;
 
+    s->old_pts = AV_NOPTS_VALUE;
     s->dmax = expf(s->limit * M_LN10 / 20.f);
     s->dmin = expf((s->limit - s->drange) * M_LN10 / 20.f);
 
@@ -1610,7 +1611,7 @@ static int activate(AVFilterContext *ctx)
             if (s->data == D_UPHASE)
                 ff_filter_execute(ctx, calc_channel_uphases, NULL, NULL, s->nb_display_channels);
 
-            if (s->xpos == 0 || s->sliding != FULLFRAME)
+            if (s->sliding != FULLFRAME || s->xpos == 0)
                 s->in_pts = fin->pts;
             ret = plot_spectrum_column(inlink, fin);
             av_frame_free(&fin);



More information about the ffmpeg-cvslog mailing list