Commit e2d643ef authored by Michael Niedermayer's avatar Michael Niedermayer

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

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 509f5029
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment