Mercurial > libavformat.hg
changeset 5467:09cb78a5b0e4 libavformat
Only add 1 index entry per keyframe.
Idea from a patch by samsung.
author | michael |
---|---|
date | Wed, 16 Dec 2009 21:24:04 +0000 |
parents | af08ed2b60b8 |
children | 4201c086a746 |
files | asfdec.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/asfdec.c Wed Dec 16 19:18:48 2009 +0000 +++ b/asfdec.c Wed Dec 16 21:24:04 2009 +0000 @@ -1065,7 +1065,7 @@ url_fseek(s->pb, asf->data_object_offset + asf->data_object_size, SEEK_SET); get_guid(s->pb, &g); if (!guidcmp(&g, &index_guid)) { - int64_t itime; + int64_t itime, last_pos=-1; int pct, ict; int64_t av_unused gsize= get_le64(s->pb); get_guid(s->pb, &g); @@ -1080,8 +1080,11 @@ int64_t pos = s->data_offset + s->packet_size*(int64_t)pktnum; int64_t index_pts= av_rescale(itime, i, 10000); + if(pos != last_pos){ av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d\n", pktnum, pktct); av_add_index_entry(s->streams[stream_index], pos, index_pts, s->packet_size, 0, AVINDEX_KEYFRAME); + last_pos=pos; + } } asf->index_read= 1; }