Commit 82ccec88 authored by michael's avatar michael

workaround some broken mpeg-ps timestamps


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3755 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 60dcaa87
......@@ -741,6 +741,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
/* cannot compute PTS if not present (we can compute it only
by knowing the futur */
} else {
if(pkt->pts != AV_NOPTS_VALUE && pkt->duration){
int64_t old_diff= ABS(st->cur_dts - pkt->duration - pkt->pts);
int64_t new_diff= ABS(st->cur_dts - pkt->pts);
if(old_diff < new_diff && old_diff < (pkt->duration>>3)){
pkt->pts += pkt->duration;
}
}
/* presentation is not delayed : PTS and DTS are the same */
if (pkt->pts == AV_NOPTS_VALUE) {
if (pkt->dts == AV_NOPTS_VALUE) {
......
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