aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-03-01 16:11:04 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-03-01 16:11:04 +0000
commit8945ebb9c1fa4ae0f734676adcb7d519d4e6664b (patch)
treea890665f1c0ccb985fdfac6cff97d3e0b8588a2f
parent115e8ae5779262449e16b8d8d79b46c48b836daf (diff)
downloadffmpeg-8945ebb9c1fa4ae0f734676adcb7d519d4e6664b.tar.gz
fixing av sync in videotest.avi (index doesnt match chunks, header doesnt indicate that)
Originally committed as revision 5088 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/avidec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 8f321fadc9..b3c96211ca 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -87,6 +87,7 @@ static int get_riff(AVIContext *avi, ByteIOContext *pb)
}
static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
+ AVIContext *avi = s->priv_data;
ByteIOContext *pb = &s->pb;
int longs_pre_entry= get_le16(pb);
int index_sub_type = get_byte(pb);
@@ -98,6 +99,7 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
AVStream *st;
AVIStream *ast;
int i;
+ int64_t last_pos= -1;
// av_log(s, AV_LOG_ERROR, "longs_pre_entry:%d index_type:%d entries_in_use:%d chunk_id:%X base:%Ld\n",
// longs_pre_entry,index_type, entries_in_use, chunk_id, base);
@@ -125,12 +127,16 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
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(last_pos == pos || pos == base - 8)
+ avi->non_interleaved= 1;
+ else
+ 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
ast->cum_len ++;
+ last_pos= pos;
}else{
int64_t offset= get_le64(pb);
int size = get_le32(pb);