avfilter/af_anlmdn: fix pts handling when timebase and 1/samplerate differ
authorPaul B Mahol <onemda@gmail.com>
Sun, 17 Nov 2019 11:25:54 +0000 (12:25 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sun, 17 Nov 2019 11:25:54 +0000 (12:25 +0100)
libavfilter/af_anlmdn.c

index 6e37452..b8aef31 100644 (file)
@@ -298,7 +298,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
             out->nb_samples = FFMIN(s->eof_left, s->offset);
             s->eof_left -= out->nb_samples;
         }
-        s->pts += s->offset;
+        s->pts += av_rescale_q(s->offset, (AVRational){1, outlink->sample_rate}, outlink->time_base);
 
         return ff_filter_frame(outlink, out);
     }