Mercurial > mplayer.hg
comparison demux_avi.c @ 1464:891d8b59f2f1
changed chunkid/size check
author | arpi |
---|---|
date | Wed, 08 Aug 2001 15:20:40 +0000 |
parents | b2f3962d0e0e |
children | 7845f6d7c4ba |
comparison
equal
deleted
inserted
replaced
1463:d377ea93892d | 1464:891d8b59f2f1 |
---|---|
192 demux->filepos=stream_tell(demux->stream); | 192 demux->filepos=stream_tell(demux->stream); |
193 id=stream_read_dword_le(demux->stream); | 193 id=stream_read_dword_le(demux->stream); |
194 if(stream_eof(demux->stream)) return 0; // EOF! | 194 if(stream_eof(demux->stream)) return 0; // EOF! |
195 | 195 |
196 if(id!=idx->ckid){ | 196 if(id!=idx->ckid){ |
197 printf("ChunkID mismatch! raw=%.4s idx=%.4s \n",(char *)&id,(char *)&idx->ckid); | 197 if(verbose) printf("ChunkID mismatch! raw=%.4s idx=%.4s \n",(char *)&id,(char *)&idx->ckid); |
198 continue; | 198 id=idx->ckid; |
199 // continue; | |
199 } | 200 } |
200 len=stream_read_dword_le(demux->stream); | 201 len=stream_read_dword_le(demux->stream); |
201 // if((len&(~1))!=(idx->dwChunkLength&(~1))){ | 202 // if((len&(~1))!=(idx->dwChunkLength&(~1))){ |
202 // if((len)!=(idx->dwChunkLength)){ | 203 // if((len)!=(idx->dwChunkLength)){ |
203 if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){ | 204 if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){ |
204 printf("ChunkSize mismatch! raw=%d idx=%ld \n",len,idx->dwChunkLength); | 205 if(verbose) printf("ChunkSize mismatch! raw=%d idx=%ld \n",len,idx->dwChunkLength); |
205 continue; | 206 len=idx->dwChunkLength; |
207 // continue; | |
206 } | 208 } |
207 if(idx->dwFlags&AVIIF_KEYFRAME) flags=1; | 209 if(idx->dwFlags&AVIIF_KEYFRAME) flags=1; |
208 } else { | 210 } else { |
209 demux->filepos=stream_tell(demux->stream); | 211 demux->filepos=stream_tell(demux->stream); |
210 if(demux->filepos>=demux->movi_end){ | 212 if(demux->filepos>=demux->movi_end){ |
280 id=stream_read_dword_le(demux->stream); | 282 id=stream_read_dword_le(demux->stream); |
281 | 283 |
282 if(stream_eof(demux->stream)) return 0; | 284 if(stream_eof(demux->stream)) return 0; |
283 | 285 |
284 if(id!=idx->ckid){ | 286 if(id!=idx->ckid){ |
285 printf("ChunkID mismatch! raw=%.4s idx=%.4s \n",(char *)&id,(char *)&idx->ckid); | 287 if(verbose) printf("ChunkID mismatch! raw=%.4s idx=%.4s \n",(char *)&id,(char *)&idx->ckid); |
286 continue; | 288 id=idx->ckid; |
289 // continue; | |
287 } | 290 } |
288 len=stream_read_dword_le(demux->stream); | 291 len=stream_read_dword_le(demux->stream); |
289 // if((len&(~1))!=(idx->dwChunkLength&(~1))){ | 292 // if((len&(~1))!=(idx->dwChunkLength&(~1))){ |
290 // if((len)!=(idx->dwChunkLength)){ | 293 // if((len)!=(idx->dwChunkLength)){ |
291 if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){ | 294 if((len!=idx->dwChunkLength)&&((len+1)!=idx->dwChunkLength)){ |
292 printf("ChunkSize mismatch! raw=%d idx=%ld \n",len,idx->dwChunkLength); | 295 if(verbose) printf("ChunkSize mismatch! raw=%d idx=%ld \n",len,idx->dwChunkLength); |
293 continue; | 296 len=idx->dwChunkLength; |
297 // continue; | |
294 } | 298 } |
295 if(idx->dwFlags&AVIIF_KEYFRAME) flags=1; | 299 if(idx->dwFlags&AVIIF_KEYFRAME) flags=1; |
296 } else return 0; | 300 } else return 0; |
297 ret=demux_avi_read_packet(demux,id,len,idx_pos,flags); | 301 ret=demux_avi_read_packet(demux,id,len,idx_pos,flags); |
298 if(!ret && skip_video_frames<=0) | 302 if(!ret && skip_video_frames<=0) |