forked from FFmpeg/FFmpeg
simplify
Originally committed as revision 8427 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
41c8a56a14
commit
14eb3345ba
1 changed files with 7 additions and 12 deletions
|
@ -618,21 +618,16 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
|
||||||
if (presentation_delayed) {
|
if (presentation_delayed) {
|
||||||
/* DTS = decompression time stamp */
|
/* DTS = decompression time stamp */
|
||||||
/* PTS = presentation time stamp */
|
/* PTS = presentation time stamp */
|
||||||
if (pkt->dts == AV_NOPTS_VALUE) {
|
if (pkt->dts == AV_NOPTS_VALUE)
|
||||||
/* if we know the last pts, use it */
|
pkt->dts = st->last_IP_pts;
|
||||||
if(st->last_IP_pts != AV_NOPTS_VALUE)
|
if (pkt->dts == AV_NOPTS_VALUE)
|
||||||
st->cur_dts = pkt->dts = st->last_IP_pts;
|
pkt->dts = st->cur_dts;
|
||||||
else
|
|
||||||
pkt->dts = st->cur_dts;
|
|
||||||
} else {
|
|
||||||
st->cur_dts = pkt->dts;
|
|
||||||
}
|
|
||||||
/* this is tricky: the dts must be incremented by the duration
|
/* this is tricky: the dts must be incremented by the duration
|
||||||
of the frame we are displaying, i.e. the last I or P frame */
|
of the frame we are displaying, i.e. the last I or P frame */
|
||||||
if (st->last_IP_duration == 0)
|
if (st->last_IP_duration == 0)
|
||||||
st->cur_dts += pkt->duration;
|
st->last_IP_duration = pkt->duration;
|
||||||
else
|
st->cur_dts = pkt->dts + st->last_IP_duration;
|
||||||
st->cur_dts += st->last_IP_duration;
|
|
||||||
st->last_IP_duration = pkt->duration;
|
st->last_IP_duration = pkt->duration;
|
||||||
st->last_IP_pts= pkt->pts;
|
st->last_IP_pts= pkt->pts;
|
||||||
/* cannot compute PTS if not present (we can compute it only
|
/* cannot compute PTS if not present (we can compute it only
|
||||||
|
|
Loading…
Add table
Reference in a new issue