From 7db61bf0e3b72274b5fe2f76fdb71edccba209a6 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 17 Nov 2019 12:17:51 +0100 Subject: [PATCH] avfilter/af_adeclick: fix pts handling when timebase and 1/samplerate differ --- libavfilter/af_adeclick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_adeclick.c b/libavfilter/af_adeclick.c index 2c42f97960..092f290888 100644 --- a/libavfilter/af_adeclick.c +++ b/libavfilter/af_adeclick.c @@ -585,7 +585,7 @@ static int filter_frame(AVFilterLink *inlink) out->nb_samples = FFMIN(s->hop_size, s->samples_left); out->pts = s->pts; - s->pts += s->hop_size; + s->pts += av_rescale_q(s->hop_size, (AVRational){1, outlink->sample_rate}, outlink->time_base); s->detected_errors += detected_errors; s->nb_samples += out->nb_samples * inlink->channels;