aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-10 03:28:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-10 03:28:42 +0200
commit67d441499a042edcfb0f8a120e6196d10b1d13db (patch)
treee87036149024e3e44fa4005ef692bcc74e623f8b /libavformat
parentca87d439065c705311d0a98076df3c021b187adb (diff)
downloadffmpeg-67d441499a042edcfb0f8a120e6196d10b1d13db.tar.gz
seeking: Favor pkt->pos for generic index building where possible.
See [FFmpeg-devel] [PATCH] Only using st->parser->pos when doing?repacking in the parser. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4a4141e073..b4c51d135a 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1102,8 +1102,9 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
compute_pkt_fields(s, st, st->parser, pkt);
if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & AV_PKT_FLAG_KEY){
+ int64_t pos= (st->parser->flags & PARSER_FLAG_COMPLETE_FRAMES) ? pkt->pos : st->parser->frame_offset;
ff_reduce_index(s, st->index);
- av_add_index_entry(st, st->parser->frame_offset, pkt->dts,
+ av_add_index_entry(st, pos, pkt->dts,
0, 0, AVINDEX_KEYFRAME);
}