[FFmpeg-cvslog] avfilter/avf_showcwt: fix output frame pts if inlink timebase does not match sample rate

Paul B Mahol git at videolan.org
Thu Jul 6 00:02:50 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jul  5 22:56:05 2023 +0200| [0cdfe46f4e2d2152632e7588fd544d8d13f6fcc2] | committer: Paul B Mahol

avfilter/avf_showcwt: fix output frame pts if inlink timebase does not match sample rate

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

 libavfilter/avf_showcwt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/avf_showcwt.c b/libavfilter/avf_showcwt.c
index ed1bc4c65a..cc8740fb82 100644
--- a/libavfilter/avf_showcwt.c
+++ b/libavfilter/avf_showcwt.c
@@ -868,6 +868,7 @@ static int output_frame(AVFilterContext *ctx)
     if (s->slide != SLIDE_FRAME || s->new_frame == 1) {
         int64_t pts_offset = s->new_frame ? 0LL : av_rescale(s->ihop_index, s->hop_size, s->ihop_size);
 
+        pts_offset = av_rescale_q(pts_offset, av_make_q(1, inlink->sample_rate), inlink->time_base);
         s->outpicref->pts = av_rescale_q(s->in_pts + pts_offset, inlink->time_base, outlink->time_base);
         s->outpicref->duration = 1;
     }



More information about the ffmpeg-cvslog mailing list