[Mplayer-cvslog] CVS: main subreader.c,1.53,1.54

Megyer Laszlo laaz at mplayer.dev.hu
Thu Feb 28 03:37:16 CET 2002


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

Modified Files:
	subreader.c 
Log Message:
-subfps and -subdelay alters -dumpmpsub's output


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- subreader.c	28 Feb 2002 01:01:50 -0000	1.53
+++ subreader.c	28 Feb 2002 02:37:13 -0000	1.54
@@ -517,6 +517,9 @@
 extern int sub_utf8;
 #endif
 
+extern float sub_delay;
+extern float sub_fps;
+
 #ifdef USE_ICONV
 static iconv_t icdsc;
 
@@ -788,7 +791,8 @@
 	FILE *fd;
 	float a,b;
 
-	mpsub_position=0.0;
+	mpsub_position=sub_uses_time?(sub_delay*100):(sub_delay*fps);
+	if (sub_fps==0) sub_fps=fps;
 
 	fd=fopen ("dump.mpsub", "w");
 	if (!fd) {
@@ -815,8 +819,8 @@
 			else
 			fprintf (fd, " %.2f\n",b);
 		} else {
-			fprintf (fd, "%ld %ld\n", (egysub->start)-((long)mpsub_position),
-					(egysub->end)-(egysub->start));
+			fprintf (fd, "%ld %ld\n", (long)((egysub->start*(fps/sub_fps))-((mpsub_position*(fps/sub_fps)))),
+					(long)(((egysub->end)-(egysub->start))*(fps/sub_fps)));
 		}
 
 		mpsub_position = egysub->end;
@@ -856,7 +860,7 @@
     sub_cp = argv[2]; 
     subs=sub_read_file(argv[1]);
     if(!subs){
-        printf("Couldn't load file... let's write a bugreport :)\n");
+        printf("Couldn't load file.\n");
         exit(1);
     }
     




More information about the MPlayer-cvslog mailing list