diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-03-01 11:29:55 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-03-01 11:29:55 +0000 |
commit | 30a43f2d09d4ddb7f6335dfd32796896e64b2655 (patch) | |
tree | ab32569d2b2a35be737151c12e375aaedd573e14 /libavformat/avidec.c | |
parent | 26d6d032702c55616127511fa317b96763eb5cb3 (diff) | |
download | ffmpeg-30a43f2d09d4ddb7f6335dfd32796896e64b2655.tar.gz |
add size to AVIndex
Originally committed as revision 5083 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 86e2e9244a..2fede84528 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -55,6 +55,7 @@ typedef struct { } AVIContext; static int avi_load_index(AVFormatContext *s); +static int guess_ni_flag(AVFormatContext *s); #ifdef DEBUG static void print_tag(const char *str, unsigned int tag, int size) @@ -118,12 +119,14 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){ for(i=0; i<entries_in_use; i++){ if(index_type){ - int64_t pos= get_le32(pb) + base; + int64_t pos= get_le32(pb) + base - 8; int len = get_le32(pb); - - av_add_index_entry(st, pos, ast->cum_len, 0, (len<0) ? 0 : AVINDEX_KEYFRAME); + int key= len >= 0; len &= 0x7FFFFFFF; +//av_log(s, AV_LOG_ERROR, "pos:%Ld, len:%X\n", pos, len); + av_add_index_entry(st, pos, ast->cum_len, len, 0, key ? AVINDEX_KEYFRAME : 0); + if(ast->sample_size) ast->cum_len += len / ast->sample_size; else @@ -412,6 +415,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) if(!avi->index_loaded) avi_load_index(s); avi->index_loaded = 1; + avi->non_interleaved |= guess_ni_flag(s); return 0; } @@ -699,7 +703,7 @@ static int avi_read_idx1(AVFormatContext *s, int size) if(last_pos == pos) avi->non_interleaved= 1; else - av_add_index_entry(st, pos, ast->cum_len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0); + av_add_index_entry(st, pos, ast->cum_len, len, 0, (flags&AVIIF_INDEX) ? AVINDEX_KEYFRAME : 0); if(ast->sample_size) ast->cum_len += len / ast->sample_size; else @@ -768,7 +772,6 @@ static int avi_load_index(AVFormatContext *s) } } the_end: - avi->non_interleaved |= guess_ni_flag(s); url_fseek(pb, pos, SEEK_SET); return 0; } |