From 748cbb6290171dccc57146cfd3a23c81d839a0dd Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 27 Jul 2001 01:16:54 +0000 Subject: trying to fix -idx problem git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1393 b3059339-0415-0410-9bf9-f77b7e298cf2 --- aviheader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'aviheader.c') diff --git a/aviheader.c b/aviheader.c index f93b312d4e..72484b34fe 100644 --- a/aviheader.c +++ b/aviheader.c @@ -158,6 +158,7 @@ if(index_mode>=2 || (demuxer->idx_size==0 && index_mode==1)){ stream_seek(demuxer->stream,demuxer->movi_start); demuxer->idx_pos=0; + demuxer->idx_size=0; demuxer->idx=NULL; while(1){ @@ -173,8 +174,11 @@ if(index_mode>=2 || (demuxer->idx_size==0 && index_mode==1)){ continue; } if(stream_eof(demuxer->stream)) break; + if(!id || avi_stream_id(id)==100) goto skip_chunk; // bad ID (or padding?) + if(demuxer->idx_pos<=demuxer->idx_size){ - demuxer->idx_size+=32; +// demuxer->idx_size+=32; + demuxer->idx_size+=1024; // +16kB demuxer->idx=realloc(demuxer->idx,demuxer->idx_size*sizeof(AVIINDEXENTRY)); if(!demuxer->idx){demuxer->idx_pos=0; break;} // error! } @@ -202,6 +206,7 @@ if(index_mode>=2 || (demuxer->idx_size==0 && index_mode==1)){ printf("\n"); } #endif +skip_chunk: skip=(len+1)&(~1); // total bytes in this chunk stream_seek(demuxer->stream,8+demuxer->filepos+skip); } -- cgit v1.2.3