[Mplayer-cvslog] CVS: main spudec.c,1.1,1.2 spudec.h,1.1,1.2 mplayer.c,1.87,1.88

GEREOFFY arpi_esp at users.sourceforge.net
Sat Apr 21 19:31:34 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv14052

Modified Files:
	spudec.c spudec.h mplayer.c 
Log Message:
spudec_decode() moved from mplayer.c to spudec.c

Index: spudec.c
===================================================================
RCS file: /cvsroot/mplayer/main/spudec.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** spudec.c	2001/04/21 15:38:01	1.1
--- spudec.c	2001/04/21 17:31:32	1.2
***************
*** 85,88 ****
--- 85,117 ----
  }
  
+ // SPU packet format:  (guess only, by A'rpi)
+ //    0  word   whole packet size
+ //    2  word   x0 sub-packet size
+ //    4  x0-2   pixel data
+ // x0+2  word   x1 sub-packet size
+ // x0+4  x1-x0-2   process control data
+ //   x1  word   lifetime
+ // x1+2  word   x1 sub-packet size again
  
+ void spudec_decode(unsigned char *packet,int len){
+   int x0, x1;
+   int d1, d2;
+   int lifetime;
+   x0 = (packet[2] << 8) + packet[3];
+   x1 = (packet[x0+2] << 8) + packet[x0+3];
+ 
+   /* /Another/ sanity check. */
+   if((packet[x1+2]<<8) + packet[x1+3] != x1) {
+     printf("spudec: Incorrect packet.\n");
+     return;
+   }
+   lifetime= ((packet[x1]<<8) + packet[x1+1]);
+   printf("lifetime=%d\n",lifetime);
+ 
+   d1 = d2 = -1;
+   spudec_process_control(packet + x0 + 2, x1-x0-2, &d1, &d2);
+ //  if((d1 != -1) && (d2 != -1)) {
+ //    spudec_process_data(packet, x0, d1, d2);
+ //  }
+ }
  

Index: spudec.h
===================================================================
RCS file: /cvsroot/mplayer/main/spudec.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** spudec.h	2001/04/21 15:38:01	1.1
--- spudec.h	2001/04/21 17:31:32	1.2
***************
*** 3,6 ****
--- 3,7 ----
  
  void spudec_process_control(unsigned char *, int, int*, int*);
+ void spudec_decode(unsigned char *packet,int len);
  
  #endif

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -r1.87 -r1.88
*** mplayer.c	2001/04/21 15:38:01	1.87
--- mplayer.c	2001/04/21 17:31:32	1.88
***************
*** 2066,2095 ****
        int len2;
        len2=(packet[0]<<8)+packet[1];
!       printf("\rDVD sub: %d / %d  \n",len,len2);
!       if(len==len2){
! 
! //-----------------------------------------------------
!   int x0, x1;
!   int d1, d2;
!   int lifetime;
!   x0 = (packet[2] << 8) + packet[3];
!   x1 = (packet[x0+2] << 8) + packet[x0+3];
! 
!   /* /Another/ sanity check. */
!   if((packet[x1+2]<<8) + packet[x1+3] != x1) {
!     printf("spudec: Incorrect packet.\n");
!     return;
!   }
!   lifetime= ((packet[x1]<<8) + packet[x1+1]);
!   printf("lifetime=%d\n",lifetime);
! 
!   d1 = d2 = -1;
!   spudec_process_control(packet + x0 + 2, x1-x0-2, &d1, &d2);
! //  if((d1 != -1) && (d2 != -1)) {
! //    spudec_process_data(packet, x0, d1, d2);
! //  }
! //-----------------------------------------------------
! 
!       } else printf("fragmented dvd-subs not yet supported!!!\n");
      } else if(len>=0) {
        printf("invalud dvd sub\n");
--- 2066,2074 ----
        int len2;
        len2=(packet[0]<<8)+packet[1];
!       if(verbose) printf("\rDVD sub: %d / %d  \n",len,len2);
!       if(len==len2)
!         spudec_decode(packet,len);
!       else
!         printf("fragmented dvd-subs not yet supported!!!\n");
      } else if(len>=0) {
        printf("invalud dvd sub\n");


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list