diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-03-15 00:46:00 +0300 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-03-15 00:46:00 +0300 |
commit | 74f5ae847de156873aeb73f180b41bc141373269 (patch) | |
tree | 292023d23f91bc35a10dadcd0065084c70aaee93 /libavformat/utils.c | |
parent | bd36f175ab902fb6f1554ca3b4d9181228d628a3 (diff) |
Add AVFMT_GENERIC_INDEX support also for formats that do not use a parser.
Originally committed as revision 17965 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e371d5d3d8..7419cc6625 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -954,6 +954,11 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) *pkt = st->cur_pkt; st->cur_pkt.data= NULL; compute_pkt_fields(s, st, NULL, pkt); s->cur_st = NULL; + if ((s->iformat->flags & AVFMT_GENERIC_INDEX) && + (pkt->flags & PKT_FLAG_KEY) && pkt->dts != AV_NOPTS_VALUE) { + ff_reduce_index(s, st->index); + av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME); + } break; } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, |