summaryrefslogtreecommitdiffstats
path: root/sub/sd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-08-12 17:30:30 +0200
committerwm4 <wm4@nowhere>2020-08-12 17:30:30 +0200
commited2e2894ab6b1743d8ba9b7334606a1648099050 (patch)
tree9abea001b3ef021459bfc394691ab147954e8742 /sub/sd_lavc.c
parentcda8f1613ff307a9e0b5528743f3e941b05dcee7 (diff)
downloadmpv-ed2e2894ab6b1743d8ba9b7334606a1648099050.tar.bz2
mpv-ed2e2894ab6b1743d8ba9b7334606a1648099050.tar.xz
sub: extend range of --sub-pos option
Seems like this is requested all the time. It seems libass allows out of range values, but does allows the subtitle to go out of the screen at the bottom (only when moving it to the top it's "clamped"). Too bad, don't do that then. The bitmap sub rendering code on the other hand is under our control, and will not move a subtitle out of the screen. Fixes: #7986
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r--sub/sd_lavc.c1
1 files changed, 1 insertions, 0 deletions
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;
}
}