changeset 9228:5ef5179188ca

- ignore movi_end if reading from stdin - assume I-only stream if no index (buggy seekable avi is still better than non-seekable)
author arpi
date Sun, 02 Feb 2003 21:32:05 +0000
parents fd31a5bef5f9
children 334a2d73e612
files libmpdemux/demux_avi.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_avi.c	Sun Feb 02 21:11:59 2003 +0000
+++ b/libmpdemux/demux_avi.c	Sun Feb 02 21:32:05 2003 +0000
@@ -182,7 +182,7 @@
 demux_stream_t *ds;
 
 do{
-  int flags=0;
+  int flags=1;
   AVIINDEXENTRY *idx=NULL;
 #if 0
   demux->filepos=stream_tell(demux->stream);
@@ -214,7 +214,7 @@
     }
 
     pos = priv->idx_offset + (unsigned long)idx->dwChunkOffset;
-    if((pos<demux->movi_start || pos>=demux->movi_end) && (demux->movi_end>demux->movi_start)){
+    if((pos<demux->movi_start || pos>=demux->movi_end) && (demux->movi_end>demux->movi_start) && (demux->stream->type!=STREAMTYPE_STREAM)){
       mp_msg(MSGT_DEMUX,MSGL_V,"ChunkOffset out of range!   idx=0x%X  \n",pos);
       continue;
     }
@@ -243,10 +243,10 @@
       if(len>0x200000 && idx->dwChunkLength>0x200000) continue; // both values bad :(
       len=choose_chunk_len(idx->dwChunkLength,len);
     }
-    if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
+    if(!(idx->dwFlags&AVIIF_KEYFRAME)) flags=0;
   } else {
     demux->filepos=stream_tell(demux->stream);
-    if(demux->filepos>=demux->movi_end && demux->movi_end>demux->movi_start){
+    if(demux->filepos>=demux->movi_end && demux->movi_end>demux->movi_start && (demux->stream->type!=STREAMTYPE_STREAM)){
           demux->stream->eof=1;
           return 0;
     }
@@ -302,7 +302,7 @@
 int ret=0;
 
 do{
-  int flags=0;
+  int flags=1;
   AVIINDEXENTRY *idx=NULL;
   int idx_pos=0;
   demux->filepos=stream_tell(demux->stream);
@@ -354,7 +354,7 @@
       if(len>0x200000 && idx->dwChunkLength>0x200000) continue; // both values bad :(
       len=choose_chunk_len(idx->dwChunkLength,len);
     }
-    if(idx->dwFlags&AVIIF_KEYFRAME) flags=1;
+    if(!(idx->dwFlags&AVIIF_KEYFRAME)) flags=0;
   } else return 0;
   ret=demux_avi_read_packet(demux,demux_avi_select_stream(demux,id),id,len,idx_pos,flags);
 //      if(!ret && priv->skip_video_frames<=0)