Commit 74f5ae84 authored by Reimar Döffinger's avatar Reimar Döffinger

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
parent bd36f175
...@@ -954,6 +954,11 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) ...@@ -954,6 +954,11 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
*pkt = st->cur_pkt; st->cur_pkt.data= NULL; *pkt = st->cur_pkt; st->cur_pkt.data= NULL;
compute_pkt_fields(s, st, NULL, pkt); compute_pkt_fields(s, st, NULL, pkt);
s->cur_st = NULL; 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; break;
} else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) {
len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size,
......
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