avfilter/af_asetnsamples: fix pts handling when timebase and 1/samplerate differ
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Jun 2014 02:22:58 +0000 (04:22 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 14 Jun 2014 02:24:13 +0000 (04:24 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/af_asetnsamples.c

index fbcf275..e830643 100644 (file)
@@ -116,7 +116,7 @@ static int push_samples(AVFilterLink *outlink)
     outsamples->pts = asns->next_out_pts;
 
     if (asns->next_out_pts != AV_NOPTS_VALUE)
-        asns->next_out_pts += nb_out_samples;
+        asns->next_out_pts += av_rescale_q(nb_out_samples, (AVRational){1, outlink->sample_rate}, outlink->time_base);
 
     ret = ff_filter_frame(outlink, outsamples);
     if (ret < 0)