Mercurial > libavformat.hg
changeset 4711:5de2c153566b libavformat
Add AVFMT_GENERIC_INDEX support also for formats that do not use a parser.
author | reimar |
---|---|
date | Sat, 14 Mar 2009 21:46:00 +0000 |
parents | 430cf07e7203 |
children | 2809dfd4c881 |
files | utils.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/utils.c Sat Mar 14 20:50:54 2009 +0000 +++ b/utils.c Sat Mar 14 21:46:00 2009 +0000 @@ -954,6 +954,11 @@ *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,