[MPlayer-dev-eng] Release 0.60pre-2 today?

Kim Minh Kaplan kmkaplan at selfoffice.com
Fri Dec 28 20:19:12 CET 2001


Oops, the modifications in mplayer.c where ok, but for spudec.c use
the following:
----------------------------------------------------------------------
-static void spudec_decode(spudec_handle_t *this)
+static void spudec_decode(spudec_handle_t *this, int pts100)
 {
-  spudec_process_control(this);
+  spudec_process_control(this, pts100)
   spudec_process_data(this);
 }

 void spudec_assemble(void *this, unsigned char *packet, int len, int pts100)
 {
   spudec_handle_t *spu = (spudec_handle_t*)this;
-  spudec_heartbeat(this, pts100);
   if (spu->packet_offset == 0) {
     unsigned int len2 = get_be16(packet);
     // Start new fragment
     if (spu->packet_reserve < len2) {
       if (spu->packet != NULL)
 	free(spu->packet);
       spu->packet = malloc(len2);
       spu->packet_reserve = spu->packet != NULL ? len2 : 0;
     }
     if (spu->packet != NULL) {
       spu->deinterlace_oddness = 0;
       spu->packet_size = len2;
       memcpy(spu->packet, packet, len);
       spu->packet_offset = len;
     }
   } else {
     // Continue current fragment
     if (spu->packet_size < spu->packet_offset + len){
       fprintf(stderr,"invalid fragment\n");
       spu->packet_size = spu->packet_offset = 0;
     } else {
       memcpy(spu->packet + spu->packet_offset, packet, len);
       spu->packet_offset += len;
     }
   }
   if (spu->packet_offset == spu->packet_size) {
-    spudec_decode(spu);
+    spudec_decode(spu, pts100);
     spu->packet_offset = 0;
   }
 }
----------------------------------------------------------------------
and also
----------------------------------------------------------------------
-static void spudec_process_control(spudec_handle_t *this)
+static int spudec_process_control(spudec_handle_t *this, int pts100)
 {
   int a,b; /* Temporary vars */
   int date, type;
   int off;
   int start_off = 0;
   int next_off;
 
   this->control_start = get_be16(this->packet + 2);
   next_off = this->control_start;
   while (start_off != next_off) {
     start_off = next_off;
     date = get_be16(this->packet + start_off);
     next_off = get_be16(this->packet + start_off + 2);
     printf("date=%d\n", date);
     off = start_off + 4;
     for (type = this->packet[off++]; type != 0xff; type = this->packet[off++]) {
       printf("cmd=%d  ",type);
       switch(type) {
       case 0x00:
 	/* Menu ID, 1 byte */
 	printf("Menu ID\n");
+	this->start_pts = pts100;
 	break;
       case 0x01:
 	/* Start display */
 	printf("Start display!\n");
-	this->start_pts = this->now_pts + date;
+	this->start_pts = pts100 + date;
 	break;
       case 0x02:
 	/* Stop display */
 	printf("Stop display!\n");
-	this->end_pts = this->now_pts + date;
+	this->end_pts = pts100 + date;
 	break;
----------------------------------------------------------------------
Kim Minh.



More information about the MPlayer-dev-eng mailing list