diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-23 18:46:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-23 19:49:25 +0200 |
commit | d0f78e77e1cde44532d613525a4f521e8effe3ed (patch) | |
tree | 2be0977378a45da7652ba85bb9c90c485d847436 | |
parent | 212f129fb8c9476c10ac6aab79dcd4e9911571c2 (diff) | |
download | ffmpeg-d0f78e77e1cde44532d613525a4f521e8effe3ed.tar.gz |
avidec: simplify avi_read_idx1()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avidec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 49f8420693..7057a91111 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1245,7 +1245,7 @@ static int avi_read_idx1(AVFormatContext *s, int size) AVIStream *ast; unsigned int index, tag, flags, pos, len, first_packet = 1; unsigned last_pos= -1; - unsigned last_len= 0; + unsigned last_idx= -1; int64_t idx1_pos, first_packet_pos = 0, data_offset = 0; nb_index_entries = size / 16; @@ -1292,12 +1292,12 @@ static int avi_read_idx1(AVFormatContext *s, int size) // switch to non-interleaved to get correct timestamps if(last_pos == pos) avi->non_interleaved= 1; - if((last_pos != pos || !last_len) && len) { + if(last_idx != pos && len) { av_add_index_entry(st, pos, ast->cum_len, len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0); + last_idx= pos; } ast->cum_len += get_duration(ast, len); last_pos= pos; - last_len= len; } return 0; } |