Mercurial > libavformat.hg
comparison utils.c @ 3056:4ce8908f4593 libavformat
Get rid of a fake timestamp discontinuity at the begin of V.VOB.
This solution is not really correct but it is quite simple. Correct would
be to do a second pass over the packets after all the headers have been
collected.
author | michael |
---|---|
date | Wed, 20 Feb 2008 03:40:07 +0000 |
parents | ed3653834ada |
children | 33ecae58665a |
comparison
equal
deleted
inserted
replaced
3055:ed3653834ada | 3056:4ce8908f4593 |
---|---|
639 assert(pkt->duration && !st->cur_dts); | 639 assert(pkt->duration && !st->cur_dts); |
640 | 640 |
641 for(; pktl; pktl= pktl->next){ | 641 for(; pktl; pktl= pktl->next){ |
642 if(pktl->pkt.stream_index != pkt->stream_index) | 642 if(pktl->pkt.stream_index != pkt->stream_index) |
643 continue; | 643 continue; |
644 if(pktl->pkt.pts == pktl->pkt.dts && pktl->pkt.dts == AV_NOPTS_VALUE){ | 644 if(pktl->pkt.pts == pktl->pkt.dts && pktl->pkt.dts == AV_NOPTS_VALUE |
645 && !pktl->pkt.duration){ | |
645 pktl->pkt.pts= pktl->pkt.dts= st->cur_dts; | 646 pktl->pkt.pts= pktl->pkt.dts= st->cur_dts; |
646 st->cur_dts += pkt->duration; | 647 st->cur_dts += pkt->duration; |
647 pktl->pkt.duration= pkt->duration; | 648 pktl->pkt.duration= pkt->duration; |
648 }else | 649 }else |
649 break; | 650 break; |
664 if (pkt->duration == 0) { | 665 if (pkt->duration == 0) { |
665 compute_frame_duration(&num, &den, st, pc, pkt); | 666 compute_frame_duration(&num, &den, st, pc, pkt); |
666 if (den && num) { | 667 if (den && num) { |
667 pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num); | 668 pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num); |
668 | 669 |
669 if(pkt->dts == AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE && st->cur_dts == 0) | 670 if(st->cur_dts == 0) |
670 update_initial_durations(s, st, pkt); | 671 update_initial_durations(s, st, pkt); |
671 } | 672 } |
672 } | 673 } |
673 | 674 |
674 /* correct timestamps with byte offset if demuxers only have timestamps | 675 /* correct timestamps with byte offset if demuxers only have timestamps |