[MPlayer-G2-dev] CVS: g2/demux demux_avi.c,1.2,1.3

Arpi of Ize syncmail at mplayerhq.hu
Sat Feb 21 23:10:54 CET 2004


CVS change done by Arpi of Ize

Update of /cvsroot/mplayer/g2/demux
In directory mail:/var2/tmp/cvs-serv30346

Modified Files:
	demux_avi.c 
Log Message:
correctly skip unknown chunks (fixes some opendml files)


Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/g2/demux/demux_avi.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demux_avi.c	31 Jan 2004 22:29:18 -0000	1.2
+++ demux_avi.c	21 Feb 2004 22:10:52 -0000	1.3
@@ -116,24 +116,6 @@
   return ds?1:0;
 }
 
-// Select ds from ID
-static demux_stream_t* demux_avi_select_stream(demuxer_t *demux,unsigned int id){
-  int stream_id=avi_stream_id(id);
-
-//  printf("demux_avi_select_stream(%d)  {a:%d/v:%d}\n",stream_id,
-//       demux->audio->id,demux->video->id);
-
-  if(demux->streams[stream_id]) return demux->streams[stream_id];
-  
-  if(id!=mmioFOURCC('J','U','N','K')){
-     // unknown
-     mp_msg(MSGT_DEMUX,MSGL_DBG2,"Unknown chunk: %.4s (%X)\n",(char *) &id,id);
-     //abort();
-  }
-  return NULL;
-}
-
-
 // return value:
 //     0 = EOF or no stream found
 //     1 = successfully read a packet
@@ -158,8 +140,7 @@
       continue;
     }
 
-    ds=demux_avi_select_stream(demuxer,id);
-    if(ds){
+    if((ds=demuxer->streams[avi_stream_id(id)])){
 	if(ds->packs+1>=MAX_PACKS || ds->bytes+len>=MAX_PACK_BYTES){
 	    // avoid buffer overflow! switch to NI parser...
 	    mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_SwitchToNi);
@@ -167,6 +148,11 @@
 	    return -1;
 	}
 	ret=demux_avi_read_packet(demuxer,ds,id,len,demuxer->priv->idx_pos-1,flags);
+    } else {
+        // unknown
+	if(id!=mmioFOURCC('J','U','N','K'))
+	    mp_msg(MSGT_DEMUX,MSGL_DBG2,"AVI: Unknown chunk: %.4s (%X) at 0x%X\n",(char *) &id,id, demuxer->filepos);
+	stream_skip(demuxer->stream,(len+1)&(~1));
     }
     
   } while(ret!=1);
@@ -224,7 +210,7 @@
       mp_msg(MSGT_HEADER,MSGL_V,"Found movie at 0x%X - 0x%X\n",(int)demuxer->movi_start,(int)demuxer->movi_end);
       if(demuxer->stream->end_pos>demuxer->movi_end) demuxer->movi_end=demuxer->stream->end_pos;
 //      if(index_mode==-2 || index_mode==2 || index_mode==0)
-//        break; // reading from non-seekable source (stdin) or forced index or no index forced
+        break; // reading from non-seekable source (stdin) or forced index or no index forced
       if(list_end>0) stream_seek(demuxer->stream,list_end); // skip movi
       list_end=0;
     }




More information about the MPlayer-G2-dev mailing list