[Mplayer-cvslog] CVS: main subreader.c,1.84,1.85

Arpi of Ize arpi at mplayerhq.hu
Sun Dec 29 22:04:58 CET 2002


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

Modified Files:
	subreader.c 
Log Message:
support for subviewer format using dots instead of commas:
00:00:27.000 --> 00:00:28.300
patch by Oskar Liljeblad <oskar at osk.mine.nu>


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- subreader.c	28 Dec 2002 15:19:34 -0000	1.84
+++ subreader.c	29 Dec 2002 21:04:45 -0000	1.85
@@ -244,7 +244,7 @@
     
     while (!current->text[0]) {
 	if (!fgets (line, LINE_LEN, fd)) return NULL;
-	if ((len=sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8)
+	if ((len=sscanf (line, "%d:%d:%d%[,.]%d --> %d:%d:%d%[,.]%d",&a1,&a2,&a3,&i,&a4,&b1,&b2,&b3,&i,&b4)) < 10)
 	    continue;
 	current->start = a1*360000+a2*6000+a3*100+a4/10;
 	current->end   = b1*360000+b2*6000+b3*100+b4/10;
@@ -854,7 +854,7 @@
 		{sub_uses_time=0;return SUB_MICRODVD;}
 	if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",     &i, &i, &i, &i, &i, &i, &i, &i)==8)
 		{sub_uses_time=1;return SUB_SUBRIP;}
-	if (sscanf (line, "%d:%d:%d,%d --> %d:%d:%d,%d", &i, &i, &i, &i, &i, &i, &i, &i)==8)
+	if (sscanf (line, "%d:%d:%d%[,.]%d --> %d:%d:%d%[,.]%d", &i, &i, &i, &i, &i, &i, &i, &i, &i, &i)==10)
 		{sub_uses_time=1;return SUB_SUBVIEWER;}
 	if (sscanf (line, "{T %d:%d:%d:%d",&i, &i, &i, &i))
 		{sub_uses_time=1;return SUB_SUBVIEWER2;}




More information about the MPlayer-cvslog mailing list