changeset 35275:317eee237d0f

Support subpos values > 100 that allow the subtitles to be clipped a bit.
author reimar
date Thu, 08 Nov 2012 18:26:13 +0000
parents 4f4a90b80a9a
children 0f09dd8843bf
files DOCS/man/en/mplayer.1 cfg-common.h sub/sub.c
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Tue Nov 06 23:09:28 2012 +0000
+++ b/DOCS/man/en/mplayer.1	Thu Nov 08 18:26:13 2012 +0000
@@ -2884,9 +2884,10 @@
 slows them down for time-based ones.
 .
 .TP
-.B \-subpos <0\-100> (useful with \-vf expand)
+.B \-subpos <0\-150> (useful with \-vf expand)
 Specify the position of subtitles on the screen.
 The value is the vertical position of the subtitle in % of the screen height.
+Values larger than 100 allow part of the subtitle to be cut off.
 .
 .TP
 .B \-subwidth <10\-100>
--- a/cfg-common.h	Tue Nov 06 23:09:28 2012 +0000
+++ b/cfg-common.h	Thu Nov 08 18:26:13 2012 +0000
@@ -610,7 +610,7 @@
     {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
     {"subfont", &sub_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},
+    {"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 150, NULL},
     {"subalign", &sub_alignment, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
     {"subwidth", &sub_width_p, CONF_TYPE_INT, CONF_RANGE, 10, 100, NULL},
     {"spualign", &spu_alignment, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL},
--- a/sub/sub.c	Tue Nov 06 23:09:28 2012 +0000
+++ b/sub/sub.c	Thu Nov 08 18:26:13 2012 +0000
@@ -979,8 +979,10 @@
 
     if (obj->y < 0)
         obj->y = 0;
+    if (sub_pos <= 100 && obj->y > dys - h)
+        obj->y = FFMAX(dys - h, 0);
     if (obj->y > dys - h)
-        obj->y = dys - h;
+        h = FFMAX(dys - obj->y, 0);
 
     obj->bbox.y2 = obj->y + h;