comparison utils.c @ 618:65787cd808e4 libavformat

workaround some broken mpeg-ps timestamps
author michael
date Wed, 15 Dec 2004 02:36:03 +0000
parents 1ca4877e42f3
children 7dbdbe073bcd
comparison
equal deleted inserted replaced
617:1ca4877e42f3 618:65787cd808e4
739 st->last_IP_duration = pkt->duration; 739 st->last_IP_duration = pkt->duration;
740 st->last_IP_pts= pkt->pts; 740 st->last_IP_pts= pkt->pts;
741 /* cannot compute PTS if not present (we can compute it only 741 /* cannot compute PTS if not present (we can compute it only
742 by knowing the futur */ 742 by knowing the futur */
743 } else { 743 } else {
744 if(pkt->pts != AV_NOPTS_VALUE && pkt->duration){
745 int64_t old_diff= ABS(st->cur_dts - pkt->duration - pkt->pts);
746 int64_t new_diff= ABS(st->cur_dts - pkt->pts);
747 if(old_diff < new_diff && old_diff < (pkt->duration>>3)){
748 pkt->pts += pkt->duration;
749 }
750 }
751
744 /* presentation is not delayed : PTS and DTS are the same */ 752 /* presentation is not delayed : PTS and DTS are the same */
745 if (pkt->pts == AV_NOPTS_VALUE) { 753 if (pkt->pts == AV_NOPTS_VALUE) {
746 if (pkt->dts == AV_NOPTS_VALUE) { 754 if (pkt->dts == AV_NOPTS_VALUE) {
747 pkt->pts = st->cur_dts; 755 pkt->pts = st->cur_dts;
748 pkt->dts = st->cur_dts; 756 pkt->dts = st->cur_dts;