aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-07-08 23:25:01 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-07-08 23:25:01 +0000
commit7efeb73a5a2dcf0018cd1e7e2a3faf7de16e4cb7 (patch)
tree702904195cb7185558a74df20fa271487eb154ee /libavformat/utils.c
parent72e043dd0fd2f216525285827531180af494b8a1 (diff)
downloadffmpeg-7efeb73a5a2dcf0018cd1e7e2a3faf7de16e4cb7.tar.gz
10000l for myself, my last change was incomplete.
This one also reverts the libav mpeg ts regression test score change. Originally committed as revision 14132 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 671595b4af..b90436a977 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -627,7 +627,7 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index,
AVStream *st= s->streams[stream_index];
AVPacketList *pktl= s->packet_buffer;
- if(st->first_dts != AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE)
+ if(st->first_dts != AV_NOPTS_VALUE || dts == AV_NOPTS_VALUE || st->cur_dts == AV_NOPTS_VALUE)
return;
st->first_dts= dts - st->cur_dts;
@@ -746,6 +746,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
of the frame we are displaying, i.e. the last I- or P-frame */
if (st->last_IP_duration == 0)
st->last_IP_duration = pkt->duration;
+ if(pkt->dts != AV_NOPTS_VALUE)
st->cur_dts = pkt->dts + st->last_IP_duration;
st->last_IP_duration = pkt->duration;
st->last_IP_pts= pkt->pts;
@@ -768,6 +769,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
if(pkt->pts == AV_NOPTS_VALUE)
pkt->pts = st->cur_dts;
pkt->dts = pkt->pts;
+ if(pkt->pts != AV_NOPTS_VALUE)
st->cur_dts = pkt->pts + pkt->duration;
}
}