[Mplayer-users] Subtitle reader for Vplayer's format.

Dariusz Pietrzak dariush at ajax.umcs.lublin.pl
Wed May 16 12:29:15 CEST 2001


I just got some movies with strange subtitles, probably vplayer.exe
reads'em.
I wrote few lines in perl to convert them into mdvd format, but it would
be easier to have mplayer handle it internaly, 
so I'm sending sample subtitle, and sample patch that makes it work.

--
Dariusz Pietrzak
Certified Nobody
-------------- next part --------------
Only in main: build
Only in main: config.h
Only in main: config.mak
diff -ru main/configure /fs/mov/1/src/new/main/configure
--- main/configure	Tue May 15 21:13:31 2001
+++ /fs/mov/1/src/new/main/configure	Mon May 14 16:46:57 2001
@@ -191,7 +191,7 @@
 fi
 pvendor=`cat /proc/cpuinfo | grep 'vendor_id' | cut -d ':' -f 2  | cut -d ' ' -f 2`
 pfamily=`cat /proc/cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2`
-pmodel=`cat /proc/cpuinfo |grep -v "model name" |grep "model" | cut -d ':' -f 2 | cut -d ' ' -f 2`
+pmodel=`cat /proc/cpuinfo | grep "model$TAB" | cut -d ':' -f 2 | cut -d ' ' -f 2`
 pstepping=`cat /proc/cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2`
 
 _mmx=no
@@ -468,10 +468,7 @@
 
 if [ $_x11 = yes ]; then
 
-_xdpms=no
 $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms &> /dev/null && _xdpms=yes
-echo $_xdpms
-echo $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms &> /dev/null 
 $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv &> /dev/null && _xv=yes
 $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm &> /dev/null && _vm=yes
 
@@ -783,7 +780,7 @@
 
 if [ $_x11 = yes ]; then
   if [ $_xdpms = yes ]; then
-    _x11lib='-lX11 -lXext '
+    _x11lib='-lX11 -lXext -lXdpms'
   else
     _x11lib='-lX11 -lXext'
   fi
Only in main: configure.eyck
diff -ru main/debian/substvars /fs/mov/1/src/new/main/debian/substvars
--- main/debian/substvars	Tue May 15 21:15:42 2001
+++ /fs/mov/1/src/new/main/debian/substvars	Sat May 12 19:55:41 2001
@@ -1 +1 @@
-shlibs:Depends=libc6 (>= 2.2.3-1), libgl1, libncurses5 (>= 5.2.20010310-1), libpng2(>=1.0.10), libsdl1.1, libstdc++2.10-glibc2.2, svgalibg1, xlibs (>> 4.0.3), zlib1g (>= 1:1.1.3)
+shlibs:Depends=libc6 (>= 2.2.1-2), liblircclient0, libncurses5, xlibs (>= 4.0.1-11)
Only in main/debian: tmp
Only in main/libac3: config.mak
Only in main/libvo: config.mak
Only in main/mp3lib: config.mak
Only in main: setup.s
diff -ru main/subreader.c /fs/mov/1/src/new/main/subreader.c
--- main/subreader.c	Tue May 15 20:23:52 2001
+++ /fs/mov/1/src/new/main/subreader.c	Sat May 12 19:55:14 2001
@@ -214,41 +214,6 @@
     return current;
 }
 
-subtitle *sub_read_line_fourth(FILE *fd,subtitle *current) {
-	char line[1001];
-	char line2[1001];
-	int a1,a2,a3,b1,b2,b3;
-	int setime,etime;
-	char *p=NULL, *q=NULL, *l=NULL;
-	int i,len,len2;
-
-	bzero (current, sizeof(current));
-
-	while (!current->text[0]) {
-		if (!fgets (line, 1000, fd)) return NULL;
-		if ((len=sscanf (line, "%d:%d:%d:",&a1,&a2,&a3)) < 3)
-			continue;
-		if (!fgets (line2, 1000, fd)) return NULL;
-		if ((len2=sscanf (line2, "%d:%d:%d:",&b1,&b2,&b3)) < 3)
-			continue;
-		// przewi? o linijk? do ty?u:
-		fseek(fd,-strlen(line2),SEEK_CUR);
-
-		current->start = a1*360000+a2*6000+a3*100;
-		current->end   = b1*360000+b2*6000+b3*100;
-		// teraz czas na wkopiowanie stringu
-		p=line;	p+=9;i=0;
-		if (*p!='|') {
-			current->text[i]=(char *)malloc (strlen(p)+1);
-			strncpy(current->text[i],p,strlen(p)-3);
-			current->text[i][strlen(p)-2]='\0';
-		}
-	}
-	current->lines=i+1;
-	return current;
-}
-
-
 
 int sub_autodetect (FILE *fd) {
     char line[1001];
@@ -268,11 +233,6 @@
 		{sub_uses_time=1;return 2;}
 	if (strstr (line, "<SAMI>"))
 		{sub_uses_time=1; return 3;}
-// hh:mm:ss: subtitle
-// hh:mm:ss: |
-	if (sscanf (line, "%d:%d:%d:",     &i, &i, &i )==3)
-		{sub_uses_time=1;return 4;}
-
     }
 
     return -1;  // too many bad lines
@@ -283,13 +243,12 @@
     FILE *fd;
     int n_max;
     subtitle *first;
-    subtitle * (*func[5])(FILE *fd,subtitle *dest)=
+    subtitle * (*func[4])(FILE *fd,subtitle *dest)=
     {
 	    sub_read_line_microdvd,
 	    sub_read_line_subrip,
 	    sub_read_line_third,
-	    sub_read_line_sami,
-	    sub_read_line_fourth
+	    sub_read_line_sami
     };
 
     fd=fopen (filename, "r"); if (!fd) return NULL;
Only in main: version.h


More information about the MPlayer-users mailing list