changeset 1464:891d8b59f2f1

changed chunkid/size check
author arpi
date Wed, 08 Aug 2001 15:20:40 +0000
parents d377ea93892d
children 194c2f643d2c
files demux_avi.c
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/demux_avi.c	Wed Aug 08 13:38:16 2001 +0000
+++ b/demux_avi.c	Wed Aug 08 15:20:40 2001 +0000
@@ -194,15 +194,17 @@
     if(stream_eof(demux->stream)) return 0; // EOF!
     
     if(id!=idx->ckid){
-      printf("ChunkID mismatch! raw=%.4s idx=%.4s  \n",(char *)&id,(char *)&idx->ckid);
-      continue;
+      if(verbose) printf("ChunkID mismatch! raw=%.4s idx=%.4s  \n",(char *)&id,(char *)&idx->ckid);
+      id=idx->ckid;
+//      continue;
     }
     len=stream_read_dword_le(demux->stream);
 //    if((len&(~1))!=(idx->dwChunkLength&(~1))){
 //    if((len)!=(idx->dwChunkLength)){
     if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){
-      printf("ChunkSize mismatch! raw=%d idx=%ld  \n",len,idx->dwChunkLength);
-      continue;
+      if(verbose) printf("ChunkSize mismatch! raw=%d idx=%ld  \n",len,idx->dwChunkLength);
+      len=idx->dwChunkLength;
+//      continue;
     }
     if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
   } else {
@@ -282,15 +284,17 @@
     if(stream_eof(demux->stream)) return 0;
 
     if(id!=idx->ckid){
-      printf("ChunkID mismatch! raw=%.4s idx=%.4s  \n",(char *)&id,(char *)&idx->ckid);
-      continue;
+      if(verbose) printf("ChunkID mismatch! raw=%.4s idx=%.4s  \n",(char *)&id,(char *)&idx->ckid);
+      id=idx->ckid;
+//      continue;
     }
     len=stream_read_dword_le(demux->stream);
 //    if((len&(~1))!=(idx->dwChunkLength&(~1))){
 //    if((len)!=(idx->dwChunkLength)){
     if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){
-      printf("ChunkSize mismatch! raw=%d idx=%ld  \n",len,idx->dwChunkLength);
-      continue;
+      if(verbose) printf("ChunkSize mismatch! raw=%d idx=%ld  \n",len,idx->dwChunkLength);
+      len=idx->dwChunkLength;
+//      continue;
     }
     if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
   } else return 0;