comparison spudec.c @ 561:36fd71db0d33

spudec_decode() moved from mplayer.c to spudec.c
author arpi_esp
date Sat, 21 Apr 2001 17:31:32 +0000
parents 28ae99036574
children 0fdcf08e7df8
comparison
equal deleted inserted replaced
560:28ae99036574 561:36fd71db0d33
82 82
83 /* printf("spudec: Processsed control type 0x%02x.\n",type); */ 83 /* printf("spudec: Processsed control type 0x%02x.\n",type); */
84 } while(off < size); 84 } while(off < size);
85 } 85 }
86 86
87 // SPU packet format: (guess only, by A'rpi)
88 // 0 word whole packet size
89 // 2 word x0 sub-packet size
90 // 4 x0-2 pixel data
91 // x0+2 word x1 sub-packet size
92 // x0+4 x1-x0-2 process control data
93 // x1 word lifetime
94 // x1+2 word x1 sub-packet size again
87 95
96 void spudec_decode(unsigned char *packet,int len){
97 int x0, x1;
98 int d1, d2;
99 int lifetime;
100 x0 = (packet[2] << 8) + packet[3];
101 x1 = (packet[x0+2] << 8) + packet[x0+3];
88 102
103 /* /Another/ sanity check. */
104 if((packet[x1+2]<<8) + packet[x1+3] != x1) {
105 printf("spudec: Incorrect packet.\n");
106 return;
107 }
108 lifetime= ((packet[x1]<<8) + packet[x1+1]);
109 printf("lifetime=%d\n",lifetime);
110
111 d1 = d2 = -1;
112 spudec_process_control(packet + x0 + 2, x1-x0-2, &d1, &d2);
113 // if((d1 != -1) && (d2 != -1)) {
114 // spudec_process_data(packet, x0, d1, d2);
115 // }
116 }
117