summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/options.rst16
-rw-r--r--options/options.c2
-rw-r--r--sub/sd_lavc.c1
3 files changed, 14 insertions, 5 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index ad7d449b33..12a482b062 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -2223,14 +2223,22 @@ Subtitles
Use fonts embedded in Matroska container files and ASS scripts (default:
yes). These fonts can be used for SSA/ASS subtitle rendering.
-``--sub-pos=<0-100>``
+``--sub-pos=<0-150>``
Specify the position of subtitles on the screen. The value is the vertical
- position of the subtitle in % of the screen height.
+ position of the subtitle in % of the screen height. 100 is the original
+ position, which is often not the absolute bottom of the screen, but with
+ some margin between the bottom and the subtitle. Values above 100 move the
+ subtitle further down.
- .. note::
+ .. admonition:: Warning
+
+ Text subtitles (as opposed to image subtitles) may be cut off if the
+ value of the option is above 100. This is a libass restriction.
This affects ASS subtitles as well, and may lead to incorrect subtitle
- rendering. Use with care, or use ``--sub-margin-y`` instead.
+ rendering in addition to the problem above.
+
+ Using ``--sub-margin-y`` can achieve this in a better way.
``--sub-speed=<0.1-10.0>``
Multiply the subtitle event timestamps with the given value. Can be used
diff --git a/options/options.c b/options/options.c
index efde6fad4b..1e104e886f 100644
--- a/options/options.c
+++ b/options/options.c
@@ -232,7 +232,7 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"stretch-image-subs-to-screen", OPT_FLAG(stretch_image_subs)},
{"image-subs-video-resolution", OPT_FLAG(image_subs_video_res)},
{"sub-fix-timing", OPT_FLAG(sub_fix_timing)},
- {"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 100)},
+ {"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 150)},
{"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)},
{"sub-gray", OPT_FLAG(sub_gray)},
{"sub-ass", OPT_FLAG(ass_enabled), .flags = UPDATE_SUB_HARD},
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index 21dd85f408..81906ceb23 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -472,6 +472,7 @@ static struct sub_bitmaps *get_bitmaps(struct sd *sd, struct mp_osd_res d,
// Allow moving up the subtitle, but only until it clips.
sub->y = MPMAX(sub->y - offset, 0);
+ sub->y = MPMIN(sub->y + sub->h, h) - sub->h;
}
}