diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-02 06:22:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-02 06:38:03 +0100 |
commit | 0b90db01b5277fdcf3a524ce481469deda202059 (patch) | |
tree | a2c22876208ec7a1790fccf1c30d3112ae8529b3 /libavformat/utils.c | |
parent | 83c418e68ee55c55bf9f1185d5cb648fc91aed0b (diff) | |
download | ffmpeg-0b90db01b5277fdcf3a524ce481469deda202059.tar.gz |
lavf: fix update_initial_durations() so it handles missing durations with the initial timestamp being known.
This fixes duplicate timestamps on mp2 in ts with non seekable input.
It also fixed the fate pva demux timestamps.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e84cd7657a..580b9fea3e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -902,17 +902,17 @@ static void update_initial_durations(AVFormatContext *s, AVStream *st, AVPacket for(; pktl; pktl= pktl->next){ if(pktl->pkt.stream_index != pkt->stream_index) continue; - if(pktl->pkt.pts == pktl->pkt.dts && pktl->pkt.dts == AV_NOPTS_VALUE + if(pktl->pkt.pts == pktl->pkt.dts && (pktl->pkt.dts == AV_NOPTS_VALUE || pktl->pkt.dts == st->first_dts) && !pktl->pkt.duration){ pktl->pkt.dts= cur_dts; if(!st->codec->has_b_frames) pktl->pkt.pts= cur_dts; - cur_dts += pkt->duration; pktl->pkt.duration= pkt->duration; }else break; + cur_dts = pktl->pkt.dts + pktl->pkt.duration; } - if(st->first_dts == AV_NOPTS_VALUE) + if(!pktl) st->cur_dts= cur_dts; } |