[Mplayer-cvslog] CVS: main mplayer.c,1.356,1.357 spudec.c,1.14,1.15

Arpi of Ize arpi at mplayer.dev.hu
Fri Dec 28 20:20:14 CET 2001


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

Modified Files:
	mplayer.c spudec.c 
Log Message:
dvdsub pts fix, based on patch by Kim Minh Kaplan

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.356
retrieving revision 1.357
diff -u -r1.356 -r1.357
--- mplayer.c	28 Dec 2001 02:04:06 -0000	1.356
+++ mplayer.c	28 Dec 2001 19:20:12 -0000	1.357
@@ -2220,13 +2220,13 @@
     if(len>=2){
       int len2;
       len2=(packet[0]<<8)+packet[1];
-      mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: %d / %d  \n",len,len2);
-      spudec_assemble(vo_spudec,packet,len,100*d_video->pts);
+      mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: %d / %d   v_pts=%5.3f  s_pts=%5.3f  \n",len,len2,d_video->pts,d_dvdsub->pts);
+      spudec_assemble(vo_spudec,packet,len,100*d_dvdsub->pts);
     } else {
-      spudec_heartbeat(vo_spudec,100*d_video->pts);
       if(len>=0)
 	mp_msg(MSGT_CPLAYER,MSGL_V,"invalid dvd sub\n");
     }
+    spudec_heartbeat(vo_spudec,100*d_video->pts);
     current_module=NULL;
   }
 #endif

Index: spudec.c
===================================================================
RCS file: /cvsroot/mplayer/main/spudec.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- spudec.c	28 Dec 2001 01:24:49 -0000	1.14
+++ spudec.c	28 Dec 2001 19:20:12 -0000	1.15
@@ -164,7 +164,7 @@
   }
 }
 
-static void spudec_process_control(spudec_handle_t *this)
+static void spudec_process_control(spudec_handle_t *this, int pts100)
 {
   int a,b; /* Temporary vars */
   int date, type;
@@ -190,12 +190,12 @@
       case 0x01:
 	/* Start display */
 	mp_msg(MSGT_SPUDEC,MSGL_DBG2,"Start display!\n");
-	this->start_pts = this->now_pts + date;
+	this->start_pts = pts100 + date;
 	break;
       case 0x02:
 	/* Stop display */
 	mp_msg(MSGT_SPUDEC,MSGL_DBG2,"Stop display!\n");
-	this->end_pts = this->now_pts + date;
+	this->end_pts = pts100 + date;
 	break;
       case 0x03:
 	/* Palette */
@@ -257,9 +257,9 @@
   }
 }
 
-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);
 }
 
@@ -267,7 +267,7 @@
 void spudec_assemble(void *this, unsigned char *packet, int len, int pts100)
 {
   spudec_handle_t *spu = (spudec_handle_t*)this;
-  spudec_heartbeat(this, pts100);
+//  spudec_heartbeat(this, pts100);
   if (spu->packet_offset == 0) {
     unsigned int len2 = get_be16(packet);
     // Start new fragment
@@ -304,7 +304,7 @@
       if(x>=4 && x==y){		// if it points to self - we're done!
         // we got it!
 	mp_msg(MSGT_SPUDEC,MSGL_DBG2,"SPUgot: off=%d  size=%d \n",spu->packet_offset,spu->packet_size);
-	spudec_decode(spu);
+	spudec_decode(spu, pts100);
 	spu->packet_offset = 0;
 	break;
       }
@@ -318,7 +318,7 @@
   }
 #else
   if (spu->packet_offset == spu->packet_size) {
-    spudec_decode(spu);
+    spudec_decode(spu, pts100);
     spu->packet_offset = 0;
   }
 #endif




More information about the MPlayer-cvslog mailing list