Mercurial > libavformat.hg
comparison utils.c @ 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 | 2f7b32083fb0 |
children | e04f51471c2a |
comparison
equal
deleted
inserted
replaced
4710:430cf07e7203 | 4711:5de2c153566b |
---|---|
952 /* no parsing needed: we just output the packet as is */ | 952 /* no parsing needed: we just output the packet as is */ |
953 /* raw data support */ | 953 /* raw data support */ |
954 *pkt = st->cur_pkt; st->cur_pkt.data= NULL; | 954 *pkt = st->cur_pkt; st->cur_pkt.data= NULL; |
955 compute_pkt_fields(s, st, NULL, pkt); | 955 compute_pkt_fields(s, st, NULL, pkt); |
956 s->cur_st = NULL; | 956 s->cur_st = NULL; |
957 if ((s->iformat->flags & AVFMT_GENERIC_INDEX) && | |
958 (pkt->flags & PKT_FLAG_KEY) && pkt->dts != AV_NOPTS_VALUE) { | |
959 ff_reduce_index(s, st->index); | |
960 av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME); | |
961 } | |
957 break; | 962 break; |
958 } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { | 963 } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { |
959 len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, | 964 len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, |
960 st->cur_ptr, st->cur_len, | 965 st->cur_ptr, st->cur_len, |
961 st->cur_pkt.pts, st->cur_pkt.dts, | 966 st->cur_pkt.pts, st->cur_pkt.dts, |