changeset 1392:20c1ff7da89c

trying to fix -idx problem
author arpi
date Fri, 27 Jul 2001 01:16:54 +0000
parents 473a03335ae6
children 5eef9e69b145
files aviheader.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/aviheader.c	Thu Jul 26 00:30:01 2001 +0000
+++ b/aviheader.c	Fri Jul 27 01:16:54 2001 +0000
@@ -158,6 +158,7 @@
   stream_seek(demuxer->stream,demuxer->movi_start);
   
   demuxer->idx_pos=0;
+  demuxer->idx_size=0;
   demuxer->idx=NULL;
 
   while(1){
@@ -173,8 +174,11 @@
       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 @@
       printf("\n");
     }
 #endif
+skip_chunk:
     skip=(len+1)&(~1); // total bytes in this chunk
     stream_seek(demuxer->stream,8+demuxer->filepos+skip);
   }