Commit e8430214 authored by Henrik Gulbrandsen's avatar Henrik Gulbrandsen Committed by Baptiste Coudurier

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
parent 57105ddd
...@@ -1812,6 +1812,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -1812,6 +1812,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
sc->sample_to_ctime_sample = 0; sc->sample_to_ctime_sample = 0;
} }
} else { } 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->pts = pkt->dts;
} }
pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? PKT_FLAG_KEY : 0; pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? PKT_FLAG_KEY : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment