changeset 8583:4c18c4e7f34e

-subwidth
author arpi
date Fri, 27 Dec 2002 21:41:40 +0000
parents 24cc8654c069
children 2d4328af7ea9
files DOCS/mplayer.1 cfg-common.h libvo/sub.c libvo/sub.h
diffstat 4 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/mplayer.1	Fri Dec 27 19:36:20 2002 +0000
+++ b/DOCS/mplayer.1	Fri Dec 27 21:41:40 2002 +0000
@@ -908,6 +908,10 @@
 Specify the position of subtitles on the screen.
 The value is the vertical position of the subtitle in % of the screen height.
 .TP
+.B \-subwidth <10\-100>
+Specify the maximum width of subtitles on the screen. Useful for TV-out.
+The value is the width of the subtitle in % of the screen width.
+.TP
 .B \-unicode
 Tells MPlayer to handle the subtitle file as UNICODE.
 .TP
--- a/cfg-common.h	Fri Dec 27 19:36:20 2002 +0000
+++ b/cfg-common.h	Fri Dec 27 21:41:40 2002 +0000
@@ -186,6 +186,7 @@
 	{"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL},
  	{"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
+ 	{"subwidth", &sub_width_p, CONF_TYPE_INT, CONF_RANGE, 10, 100, NULL},
 #ifdef HAVE_FREETYPE
 	{"subfont-encoding", &subtitle_font_encoding, CONF_TYPE_STRING, 0, 0, 0, NULL},
  	{"subfont-text-scale", &text_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL},
--- a/libvo/sub.c	Fri Dec 27 19:36:20 2002 +0000
+++ b/libvo/sub.c	Fri Dec 27 21:41:40 2002 +0000
@@ -37,6 +37,7 @@
 int sub_unicode=0;
 int sub_utf8=0;
 int sub_pos=100;
+int sub_width_p=100;
 int sub_alignment=0; /* 0=top, 1=center, 2=bottom */
 int sub_visibility=1;
 
@@ -374,7 +375,7 @@
 	      }
 	      obj->params.subtitle.utbl[k++]=c;
 	      xsize+=vo_font->width[c]+vo_font->charspace+kerning(vo_font,prevc,c);
-	      if (dxs<xsize){
+	      if (dxs*sub_width_p/100<xsize){
 		  prevc = -1;
 		 if (lastStripPosition>0){
 		    j=lastStripPosition;
--- a/libvo/sub.h	Fri Dec 27 19:36:20 2002 +0000
+++ b/libvo/sub.h	Fri Dec 27 21:41:40 2002 +0000
@@ -97,6 +97,7 @@
 extern char *sub_cp;
 #endif
 extern int sub_pos;
+extern int sub_width_p;
 extern int sub_alignment;
 extern int sub_visibility;
 extern int suboverlap_enabled;