[Mplayer-cvslog] CVS: main mplayer.c,1.696,1.697 => breaks dvd subtitles + PATCH

Pierre Lombard p_l at gmx.fr
Sun Jun 1 21:47:17 CEST 2003


* Alex Beregszaszi <alex at mplayerhq.hu> [2003-05-30 19:59]:
> Update of /cvsroot/mplayer/main
> In directory mail:/var/tmp.root/cvs-serv7496
> 
> Modified Files:
> 	mplayer.c 
> Log Message:
> changed the silly func-inside-func codepice

This update is incorrect and breaks dvd subtitles displaying.
A possible patch against mplayer.c 1.701 is attached to this mail.

> 
> Index: mplayer.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/mplayer.c,v
> retrieving revision 1.696
> retrieving revision 1.697
> diff -u -r1.696 -r1.697
> --- mplayer.c	30 May 2003 17:53:03 -0000	1.696
> +++ mplayer.c	30 May 2003 18:30:24 -0000	1.697
> @@ -3388,9 +3388,11 @@
>    // DVD sub:
>  if(vo_config_count && vo_spudec) {
>    unsigned char* packet=NULL;
                          ~~~~~~~
> -  int len,timestamp;
> +  int len=1,timestamp;
> +  current_module="spudec";
> +  spudec_heartbeat(vo_spudec,90000*sh_video->timer);
>      // Get a sub packet from the dvd or a vobsub and make a timestamp relative to sh_video->timer
> -  int get_sub_packet(void) {
> +  while(len>0 && packet){
                ~~~~~~~~~~~~~
>      // Vobsub
>      len = 0;
>      if(vo_vobsub) {
> @@ -3410,11 +3412,6 @@
>  	mp_dbg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d  v_pts=%5.3f  s_pts=%5.3f  ts=%d \n",len,sh_video->pts,d_dvdsub->pts,timestamp);
>        }
>      }
> -    return len;
> -  }
> -  current_module="spudec";
> -  spudec_heartbeat(vo_spudec,90000*sh_video->timer);
> -  while(get_sub_packet()>0 && packet){
>        if(timestamp < 0) timestamp = 0;
>        spudec_assemble(vo_spudec,packet,len,timestamp);
>    }
--
Pierre
 
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.701
diff -u -r1.701 mplayer.c
--- mplayer.c	31 May 2003 21:50:21 -0000	1.701
+++ mplayer.c	1 Jun 2003 20:07:35 -0000
@@ -3430,7 +3430,7 @@
   current_module="spudec";
   spudec_heartbeat(vo_spudec,90000*sh_video->timer);
     // Get a sub packet from the dvd or a vobsub and make a timestamp relative to sh_video->timer
-  while(len>0 && packet){
+  while(len>0){
     // Vobsub
     len = 0;
     if(vo_vobsub) {
@@ -3450,8 +3450,12 @@
 	mp_dbg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: len=%d  v_pts=%5.3f  s_pts=%5.3f  ts=%d \n",len,sh_video->pts,d_dvdsub->pts,timestamp);
       }
     }
-      if(timestamp < 0) timestamp = 0;
-      spudec_assemble(vo_spudec,packet,len,timestamp);
+
+    if (!len || !packet) 
+      break;
+
+    if(timestamp < 0) timestamp = 0;
+    spudec_assemble(vo_spudec,packet,len,timestamp);
   }
   
   /* detect wether the sub has changed or not */


More information about the MPlayer-cvslog mailing list