summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat')
-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;