set pkt duration, only when dts == pts though,

patch by Henrik Gulbrandsen henrik at gulbra dot net

Originally committed as revision 13003 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Henrik Gulbrandsen 2008-04-26 17:51:02 +00:00 committed by Baptiste Coudurier
parent 57105ddd03
commit e8430214c3
1 changed files with 4 additions and 0 deletions

View File

@ -1812,6 +1812,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
sc->sample_to_ctime_sample = 0;
}
} else {
AVStream *st = s->streams[sc->ffindex];
int64_t next_dts = (sc->current_sample < sc->sample_count) ?
st->index_entries[sc->current_sample].timestamp : st->duration;
pkt->duration = next_dts - pkt->dts;
pkt->pts = pkt->dts;
}
pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? PKT_FLAG_KEY : 0;