[Mplayer-cvslog] CVS: main/libmpdemux demux_viv.c,1.12,1.13

Alex Beregszaszi alex at mplayer.dev.hu
Sat Dec 1 17:32:09 CET 2001


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

Modified Files:
	demux_viv.c 
Log Message:
added support for packet 0x82 (from vivodump.c by arpi)

Index: demux_viv.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_viv.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- demux_viv.c	25 Nov 2001 16:33:39 -0000	1.12
+++ demux_viv.c	1 Dec 2001 16:32:07 -0000	1.13
@@ -245,12 +245,22 @@
   int c;
   int len=0;
   int seq;
+  int prefix=0;
   demux->filepos=stream_tell(demux->stream);
   
   c=stream_read_char(demux->stream);
   if (c == -256) /* EOF */
     return 0;
-//  printf("c=%02X\n",c);
+//  printf("c=%x,%02X\n",c,c&0xf0);
+  if (c == 0x82)
+  {
+      /* ok, this works, but pts calculating from header is required! */
+#warning "Calculate PTS from picture header!"
+      prefix = 1;
+      c = stream_read_char(demux->stream);
+      printf("packet 0x82(pos=%lu) chunk=%x\n",
+        stream_tell(demux->stream), c);
+  }
   switch(c&0xF0){
   case 0x00: // header - skip it!
   {
@@ -269,7 +279,10 @@
       break;
   }
   case 0x10:  // video packet
-      len=128;
+      if (prefix == 1)
+        len = stream_read_char(demux->stream);
+      else
+        len=128;
       ds=demux->video;
       break;
   case 0x20:  // video packet
@@ -277,16 +290,26 @@
       ds=demux->video;
       break;
   case 0x30:  // audio packet
-      len=40;	/* 40kbps */
+      if (prefix == 1)
+        len = stream_read_char(demux->stream);
+      else
+        len=40;	/* 40kbps */
       ds=demux->audio;
       break;
   case 0x40:  // audio packet
-      len=24;	/* 24kbps */
+      if (prefix == 1)
+        len = stream_read_char(demux->stream);
+      else
+        len=24;	/* 24kbps */
       ds=demux->audio;
       break;
   default:
-      mp_msg(MSGT_DEMUX,MSGL_WARN,"VIVO - unknown ID found: %02X contact author!\n",c);
+      mp_msg(MSGT_DEMUX,MSGL_WARN,"VIVO - unknown ID found: %02X at pos %lu contact author!\n",
+        c, stream_tell(demux->stream));
+      return 0;
   }
+
+//  printf("chunk=%x, len=%d\n", c, len);
   
   if(!ds || ds->id<-1){
       if(len) stream_skip(demux->stream,len);




More information about the MPlayer-cvslog mailing list