diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-27 21:41:40 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-27 21:41:40 +0000 |
commit | 501706292e8d4c5270b6becebeca6320cba90057 (patch) | |
tree | 1e80eae83d64c8376e77dca3e313bf9679a591be | |
parent | 971294ed0e63d86419169906bd7766bade36c394 (diff) |
-subwidth
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8584 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | DOCS/mplayer.1 | 4 | ||||
-rw-r--r-- | cfg-common.h | 1 | ||||
-rw-r--r-- | libvo/sub.c | 3 | ||||
-rw-r--r-- | libvo/sub.h | 1 |
4 files changed, 8 insertions, 1 deletions
diff --git a/DOCS/mplayer.1 b/DOCS/mplayer.1 index 42b50079a3..e35bd47def 100644 --- a/DOCS/mplayer.1 +++ b/DOCS/mplayer.1 @@ -908,6 +908,10 @@ Same as \-audiofile, but for subtitle streams (OggDS?). 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 diff --git a/cfg-common.h b/cfg-common.h index d4f5e910f0..f514e7bfab 100644 --- a/cfg-common.h +++ b/cfg-common.h @@ -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}, diff --git a/libvo/sub.c b/libvo/sub.c index 1c1f74ec6b..09dd3cf1d1 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -37,6 +37,7 @@ unsigned char* vo_osd_text=NULL; 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 @@ inline static void vo_update_text_sub(mp_osd_obj_t* obj,int dxs,int dys){ } 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; diff --git a/libvo/sub.h b/libvo/sub.h index 5c904c9e1c..66be2a280f 100644 --- a/libvo/sub.h +++ b/libvo/sub.h @@ -97,6 +97,7 @@ extern int sub_utf8; 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; |