lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-09-14 19:46:44 +02:00
parent 509f502902
commit e2d643efcd
1 changed files with 1 additions and 1 deletions

View File

@ -1114,7 +1114,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
pkt->duration ) {
int duration = pkt->duration;
if(pkt->pts != AV_NOPTS_VALUE && duration){
if(st->cur_dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && duration){
int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts);
int64_t new_diff= FFABS(st->cur_dts - pkt->pts);
if( old_diff < new_diff && old_diff < (duration>>3)