[FFmpeg-cvslog] af_aresample: fix rounding of negative timestamps

Michael Niedermayer git at videolan.org
Mon Nov 26 16:33:25 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 26 16:25:47 2012 +0100| [4b5a12a2cb0252c4a08b6d099eaf69523e8c62e5] | committer: Michael Niedermayer

af_aresample: fix rounding of negative timestamps

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/af_aresample.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 5e43281..9218689 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -191,11 +191,10 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
         int64_t inpts = av_rescale(insamplesref->pts, inlink->time_base.num * (int64_t)outlink->sample_rate * inlink->sample_rate, inlink->time_base.den);
         int64_t outpts= swr_next_pts(aresample->swr, inpts);
         aresample->next_pts =
-        outsamplesref->pts  = (outpts + inlink->sample_rate/2) / inlink->sample_rate;
+        outsamplesref->pts  = ROUNDED_DIV(outpts, inlink->sample_rate);
     } else {
         outsamplesref->pts  = AV_NOPTS_VALUE;
     }
-
     n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out,
                                  (void *)insamplesref->extended_data, n_in);
     if (n_out <= 0) {



More information about the ffmpeg-cvslog mailing list