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>
This commit is contained in:
Michael Niedermayer 2012-05-18 23:03:27 +02:00
parent 4def5d2b64
commit 96ac8663de
1 changed files with 3 additions and 1 deletions

View File

@ -184,7 +184,9 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
if(insamplesref->pts != AV_NOPTS_VALUE) { if(insamplesref->pts != AV_NOPTS_VALUE) {
aresample->next_pts = 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{ } else{
outsamplesref->pts = AV_NOPTS_VALUE; //aresample->next_pts; outsamplesref->pts = AV_NOPTS_VALUE; //aresample->next_pts;
} }