aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-18 23:03:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-18 23:03:27 +0200
commit96ac8663deb71b5bff7a9f8ef45ccd361f698729 (patch)
tree230bf4624f037448ea88d1e7232291fe0817f0b0
parent4def5d2b64d78a6f15c6c8869c28ece1f823626e (diff)
downloadffmpeg-96ac8663deb71b5bff7a9f8ef45ccd361f698729.tar.gz
af_aresample: Consider the swresample delay during calculating timestamps.
The difference from this should be pretty small. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/af_aresample.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 91aee91af2..e33620ac79 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -184,7 +184,9 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
if(insamplesref->pts != AV_NOPTS_VALUE) {
aresample->next_pts =
- outsamplesref->pts = av_rescale_q(insamplesref->pts, inlink->time_base, outlink->time_base);
+ outsamplesref->pts = av_rescale_q(insamplesref->pts, inlink->time_base, outlink->time_base)
+ - swr_get_delay(aresample->swr, outlink->time_base.den);
+ av_assert0(outlink->time_base.num == 1);
} else{
outsamplesref->pts = AV_NOPTS_VALUE; //aresample->next_pts;
}