}
}
- if(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)){
- pkt->pts += duration;
- // av_log(NULL, AV_LOG_DEBUG, "id:%d old:%"PRId64" new:%"PRId64" dur:%d cur:%"PRId64" size:%d\n", pkt->stream_index, old_diff, new_diff, pkt->duration, st->cur_dts, pkt->size);
- }
- }
-
/* presentation is not delayed : PTS and DTS are the same */
if(pkt->pts == AV_NOPTS_VALUE)
pkt->pts = pkt->dts;