[Mplayer-cvslog] CVS: main subreader.c,1.71,1.72

Atmosfear atmos4 at mplayerhq.hu
Sun Oct 6 04:59:19 CEST 2002


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

Modified Files:
	subreader.c 
Log Message:
Enable -subfps for time based subtitles, too.

Please update the DOCS for -subfps:
"If you have time-based subtitles like subviewer that can't be synced by -subdelay
try specifying -subfps with the framerate of the movie the time-based sub was
created for, eg. -subfps 25 if you use subs from a 25 fps movie with a movie
using a different framerate. If you need to guess -subfps, try 25, 23.98 and 29.97"


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- subreader.c	6 Oct 2002 00:46:47 -0000	1.71
+++ subreader.c	6 Oct 2002 02:59:04 -0000	1.72
@@ -735,7 +735,7 @@
 	unsigned long subfms = (sub_uses_time ? 100 : fps) * subtime;
 	
 	n=m=0;
-	if (i)	for (;;){	
+	if (i)	for (;;){
 		if (sub->end <= sub->start){
 			sub->end = sub->start + subfms;
 			m++;
@@ -750,6 +750,22 @@
 			if (!m)
 				n++;
 		}
+
+		/* Theory:
+		 * Movies are often converted from FILM (24 fps)
+		 * to PAL (25) by simply speeding it up, so we
+		 * to multiply the original timestmaps by
+		 * (Movie's FPS / Subtitle's (guessed) FPS)
+		 * so eg. for 23.98 fps movie and PAL time based
+		 * subtitles we say -subfps 25 and we're fine!
+		 */
+
+		/* timed sub fps correction ::atmos */
+		if(sub_uses_time && sub_fps) {	
+			sub->start *= sub_fps/fps;
+			sub->end   *= sub_fps/fps;
+		}
+
 		sub = nextsub;
 		m = 0;
 	}




More information about the MPlayer-cvslog mailing list