aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Gulbrandsen <henrik@gulbra.net>2008-04-26 17:51:02 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-04-26 17:51:02 +0000
commite8430214c35d0f8c070752ba3dada76657376e72 (patch)
tree2f134b7159af8ca4841d1436b2039e1b1dbb4c05
parent57105ddd036927099cc28ed520546c2f2bb6d496 (diff)
downloadffmpeg-e8430214c35d0f8c070752ba3dada76657376e72.tar.gz
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
-rw-r--r--libavformat/mov.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9406c4e108..611d547734 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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;