diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-26 20:17:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-26 21:09:15 +0100 |
commit | 8d231e37af0cfd7dd52bdea57d144f2c663664ae (patch) | |
tree | f96f7e4c1626c29ffa04e584f1b556408d7620a7 /libavfilter | |
parent | 89d5262289ae02f31e1d04ac1400ca5c56242d50 (diff) | |
download | ffmpeg-8d231e37af0cfd7dd52bdea57d144f2c663664ae.tar.gz |
af_aresample: consistently use ROUNDED_DIV
This fixes issues with negative timestamps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_aresample.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 9218689d7d..0f5f09161e 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); |