[FFmpeg-cvslog] af_aresample: consistently use ROUNDED_DIV
Michael Niedermayer
git at videolan.org
Mon Nov 26 21:09:49 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 26 20:17:16 2012 +0100| [8d231e37af0cfd7dd52bdea57d144f2c663664ae] | committer: Michael Niedermayer
af_aresample: consistently use ROUNDED_DIV
This fixes issues with negative timestamps
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d231e37af0cfd7dd52bdea57d144f2c663664ae
---
libavfilter/af_aresample.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 9218689..0f5f091 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -243,7 +243,8 @@ static int request_frame(AVFilterLink *outlink)
if(aresample->next_pts != AV_NOPTS_VALUE)
aresample->next_pts += av_rescale_q(n_out, (AVRational){1 ,outlink->sample_rate}, outlink->time_base);
#else
- outsamplesref->pts = (swr_next_pts(aresample->swr, INT64_MIN) + inlink->sample_rate/2) / inlink->sample_rate;
+ outsamplesref->pts = swr_next_pts(aresample->swr, INT64_MIN);
+ outsamplesref->pts = ROUNDED_DIV(outsamplesref->pts, inlink->sample_rate);
#endif
ff_filter_samples(outlink, outsamplesref);
More information about the ffmpeg-cvslog
mailing list