changeset 4886:712c8fc897fd

-subfps and -subdelay alters -dumpmpsub's output
author laaz
date Thu, 28 Feb 2002 02:37:13 +0000
parents fbafa2f216f5
children 6d753f5dde1e
files subreader.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Thu Feb 28 01:43:06 2002 +0000
+++ b/subreader.c	Thu Feb 28 02:37:13 2002 +0000
@@ -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);
     }