changeset 6705:68506f182491

Fix Vobsub output synchro.
author kmkaplan
date Thu, 11 Jul 2002 18:48:43 +0000
parents fbb02e1b53c8
children e1428c2c971f
files mencoder.c
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Thu Jul 11 16:14:55 2002 +0000
+++ b/mencoder.c	Thu Jul 11 18:48:43 2002 +0000
@@ -311,8 +311,6 @@
 int file_format=DEMUXER_TYPE_UNKNOWN;
 int i;
 void *vobsub_writer=NULL;
-double vobsubout_origin_pts=0.0;
-int vobsubout_origin_pts_set=0;
 
 uint32_t ptimer_start;
 uint32_t audiorate=0;
@@ -1151,16 +1149,12 @@
  if(vo_spudec||vobsub_writer){
      unsigned char* packet=NULL;
      int len;
-     if (vobsub_writer && !vobsubout_origin_pts_set) {
-	 vobsubout_origin_pts_set = 1;
-	 vobsubout_origin_pts = d_video->pts;
-     }
      while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){
 	 mp_msg(MSGT_MENCODER,MSGL_V,"\rDVD sub: len=%d  v_pts=%5.3f  s_pts=%5.3f  \n",len,d_video->pts,d_dvdsub->pts);
 	 if (vo_spudec)
 	 spudec_assemble(vo_spudec,packet,len,90000*d_dvdsub->pts);
 	 if (vobsub_writer)
-	     vobsub_out_output(vobsub_writer,packet,len,d_dvdsub->pts-vobsubout_origin_pts);
+	     vobsub_out_output(vobsub_writer,packet,len,mux_v->timer + d_dvdsub->pts - d_video->pts);
      }
      if (vo_spudec) {
      spudec_heartbeat(vo_spudec,90000*d_video->pts);