aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-02-20 03:40:07 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-02-20 03:40:07 +0000
commit91acf9a8bcd2372b34657ff4364c26ee876044fd (patch)
tree68d73f565ece8d8787fa70b856c01c0339208cc5 /libavformat
parentff2635b273269dff524bc89242902011b68794ff (diff)
downloadffmpeg-91acf9a8bcd2372b34657ff4364c26ee876044fd.tar.gz
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. Originally committed as revision 12157 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4936349d7d..24df336653 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -641,7 +641,8 @@ 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.duration){
pktl->pkt.pts= pktl->pkt.dts= st->cur_dts;
st->cur_dts += pkt->duration;
pktl->pkt.duration= pkt->duration;
@@ -666,7 +667,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if (den && num) {
pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den, den * (int64_t)st->time_base.num);
- if(pkt->dts == AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE && st->cur_dts == 0)
+ if(st->cur_dts == 0)
update_initial_durations(s, st, pkt);
}
}