[Mplayer-cvslog] CVS: main aviheader.c,1.25,1.26

Arpi of Ize arpi at mplayer.dev.hu
Thu Aug 23 23:10:33 CEST 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv24730

Modified Files:
	aviheader.c 
Log Message:
print AVI info block (copyright,artist etc) (-v only)

Index: aviheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/aviheader.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- aviheader.c	17 Aug 2001 00:40:25 -0000	1.25
+++ aviheader.c	23 Aug 2001 21:10:31 -0000	1.26
@@ -44,13 +44,14 @@
   int id=stream_read_dword_le(demuxer->stream);
   int chunksize,size2;
   static int last_fccType=0;
+  char* hdr=NULL;
   //
   if(stream_eof(demuxer->stream)) break;
   //
   if(id==mmioFOURCC('L','I','S','T')){
     int len=stream_read_dword_le(demuxer->stream)-4; // list size
     id=stream_read_dword_le(demuxer->stream);        // list type
-    mp_dbg(MSGT_HEADER,MSGL_DBG2,"LIST %.4s  len=%d\n",(char *) &id,len);
+    mp_msg(MSGT_HEADER,MSGL_DBG2,"LIST %.4s  len=%d\n",(char *) &id,len);
     if(id==listtypeAVIMOVIE){
       // found MOVI header
       demuxer->movi_start=stream_tell(demuxer->stream);
@@ -63,9 +64,15 @@
     continue;
   }
   size2=stream_read_dword_le(demuxer->stream);
-  mp_dbg(MSGT_HEADER,MSGL_DBG2,"CHUNK %.4s  len=%d\n",(char *) &id,size2);
+  mp_msg(MSGT_HEADER,MSGL_DBG2,"CHUNK %.4s  len=%d\n",(char *) &id,size2);
   chunksize=(size2+1)&(~1);
   switch(id){
+    case mmioFOURCC('I','S','F','T'): hdr="Software";break;
+    case mmioFOURCC('I','N','A','M'): hdr="Name";break;
+    case mmioFOURCC('I','S','B','J'): hdr="Subject";break;
+    case mmioFOURCC('I','A','R','T'): hdr="Artist";break;
+    case mmioFOURCC('I','C','O','P'): hdr="Copyright";break;
+    case mmioFOURCC('I','C','M','T'): hdr="Comment";break;
     case ckidAVIMAINHDR:          // read 'avih'
       stream_read(demuxer->stream,(char*) &avih,MIN(size2,sizeof(avih)));
       le2me_MainAVIHeader(&avih); // swap to machine endian
@@ -151,6 +158,14 @@
       if(verbose>=2) print_index(priv->idx,priv->idx_size);
       break;
     }
+  }
+  if(hdr){
+      char buf[256];
+      int len=(size2<250)?size2:250;
+      stream_read(demuxer->stream,buf,len);
+      chunksize-=len;
+      buf[len]=0;
+      mp_msg(MSGT_HEADER,MSGL_V,"%-10s: %s\n",hdr,buf);
   }
   if(chunksize>0) stream_skip(demuxer->stream,chunksize); else
   if(chunksize<0) mp_msg(MSGT_HEADER,MSGL_WARN,"chunksize=%d  (id=%.4s)\n",chunksize,(char *) &id);




More information about the MPlayer-cvslog mailing list