[MPlayer-dev-eng] a patch for broken vplayer 'n udvd subfiles

Arkadiusz Podgorski wodzu at softomat.com.pl
Wed Mar 20 15:26:51 CET 2002


Hi! I've got some subtitle files with broken format. A few weeks ago I made
a patch and wanted to send it, but forgot. ;-) I downloaded a mplayer current
version yesterday and noticed, that some of them are made by someone other
(especially no ending time for udvd format), but there are some weaknes
still. The problem remains in case of vplayer subtitles when time and title
are separated using space char. I added detecting such file (when first line
has space instead colon) and corrected a way to find the first char of
title. Attached file is a 3c patch for subreader.c file.

-- 
# *sig. under construction* #%#--#####+####+#######x############++=##
nie moge dojsc, jak oni uzywaja wielkich liter. 
moze maja inny typ klawiatury?
#"+####%%#####+##=###%### _wodzu at sail-ho.pl_ ##%####**###||###|##+###
-------------- next part --------------
*** subreader.orig	Tue Mar 19 14:26:42 2002
--- subreader.c	Tue Mar 19 14:33:12 2002
***************
*** 265,270 ****
--- 265,271 ----
  		
  		if (!(current->start = a1*360000+a2*6000+a3*100))
  			continue;
+                 /* removed by wodzu
  		p=line;	
   		// finds the body of the subtitle
   		for (i=0; i<3; i++){              
***************
*** 276,281 ****
--- 277,287 ----
  		    printf("SUB: Skipping incorrect subtitle line!\n");
  		    continue;
  		}
+                 */
+                 // by wodzu: hey! this time we know what length it has! what is
+                 // that magic for? it can't deal with space instead of third
+                 // colon! look, what simple it can be:
+                 p = &line[ plen ];
  
   		i=0;
  		if (*p!='|') {
***************
*** 488,493 ****
--- 494,501 ----
  	if (strstr (line, "<SAMI>"))
  		{sub_uses_time=1; return SUB_SAMI;}
  	if (sscanf (line, "%d:%d:%d:",     &i, &i, &i )==3)
+ 		{sub_uses_time=1;return SUB_VPLAYER;}
+ 	if (sscanf (line, "%d:%d:%d ",     &i, &i, &i )==3)
  		{sub_uses_time=1;return SUB_VPLAYER;}
  	//TODO: just checking if first line of sub starts with "<" is WAY
  	// too weak test for RT


More information about the MPlayer-dev-eng mailing list