[Mplayer-cvslog] CVS: main cfg-common.h,1.68,1.69 mencoder.c,1.187,1.188 mplayer.c,1.619,1.620 subreader.c,1.79,1.80 subreader.h,1.19,1.20

Arpi of Ize arpi at mplayerhq.hu
Thu Dec 5 01:04:05 CET 2002


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

Modified Files:
	cfg-common.h mencoder.c mplayer.c subreader.c subreader.h 
Log Message:
overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
patch by Salvatore Falco <sfalco at studenti.ing.uniroma1.it>


Index: cfg-common.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-common.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- cfg-common.h	31 Oct 2002 10:42:20 -0000	1.68
+++ cfg-common.h	5 Dec 2002 00:03:26 -0000	1.69
@@ -180,6 +180,7 @@
 	{"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	// enable Closed Captioning display
 	{"subcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"nooverlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL},
 #endif
 #ifdef USE_OSD
 	{"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL},

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -r1.187 -r1.188
--- mencoder.c	4 Dec 2002 23:37:17 -0000	1.187
+++ mencoder.c	5 Dec 2002 00:03:26 -0000	1.188
@@ -162,6 +162,7 @@
 float sub_fps=0;
 int   sub_auto = 0;
 int   subcc_enabled=0;
+int   suboverlap_enabled = 1;
 
 #ifdef USE_SUB
 static subtitle* subtitles=NULL;

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.619
retrieving revision 1.620
diff -u -r1.619 -r1.620
--- mplayer.c	4 Dec 2002 23:58:30 -0000	1.619
+++ mplayer.c	5 Dec 2002 00:03:26 -0000	1.620
@@ -256,6 +256,7 @@
 char *vobsub_name=NULL;
 /*DSP!!char *dsp=NULL;*/
 int   subcc_enabled=0;
+int suboverlap_enabled = 1;
 #ifdef USE_SUB
 subtitle* subtitles=NULL;
 float sub_last_pts = -303;

Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- subreader.c	4 Dec 2002 23:58:31 -0000	1.79
+++ subreader.c	5 Dec 2002 00:03:26 -0000	1.80
@@ -1048,7 +1048,7 @@
     }
 
     adjust_subs_time(first, 6.0, fps, 0);	/* ~6 secs AST */
-
+if(suboverlap_enabled){
 // here we manage overlapping subtitles
     sub_orig = sub_num;
     n_first = sub_num;
@@ -1057,7 +1057,7 @@
     second = NULL;
 // for each subtitle in first[]
     for (sub_first = 0; sub_first < n_first; ++sub_first) {
-	while (first[sub_first].start <= first[sub_first].end) {
+	while (first[sub_first].start < first[sub_first].end) {
 	    unsigned long end_time = first[sub_first].end;
 	    int lines_to_add = 0, sub_to_add, event, ls, lf;
 
@@ -1144,6 +1144,11 @@
     }
 
     return second;
+} else { //if(suboverlap_enabled)
+    adjust_subs_time(first, 6.0, fps, 1);	/* ~6 secs AST */
+
+    return first;
+}
 }
 
 #if 0

Index: subreader.h
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- subreader.h	30 Oct 2002 19:16:58 -0000	1.19
+++ subreader.h	5 Dec 2002 00:03:26 -0000	1.20
@@ -4,6 +4,7 @@
 extern int sub_uses_time;
 extern int sub_errs;
 extern int sub_num;         // number of subtitle structs
+extern int suboverlap_enabled;
 
 // subtitle formats
 #define SUB_INVALID   -1




More information about the MPlayer-cvslog mailing list