summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-10 15:51:44 -0500
committerDudemanguy <random342@airmail.cc>2023-08-13 19:58:20 +0000
commit6ea08be59ac503f7309a19a50d5e664426e8c9f3 (patch)
treeb1fa116ee9c70e20bd0b8d390382c99de3c3a1c2 /sub/sd_ass.c
parent331832f55df4d4c2bbf1231a6e519ef7a96aea8c (diff)
downloadmpv-6ea08be59ac503f7309a19a50d5e664426e8c9f3.tar.bz2
mpv-6ea08be59ac503f7309a19a50d5e664426e8c9f3.tar.xz
player: make sub-pos a float value
mpv makes this option an integer, but the underlying ass API actually accepts doubles. From some testing, there is no meaningful precision difference between float or double (it seems to go in roughly 0.05 steps), so just make it a float. sd_lavc also can handle non-integer values here. Closes #11583.
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index e4e5652875..a4df24e0ae 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -388,7 +388,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
ass_set_margins(priv, dim->mt, dim->mb, dim->ml, dim->mr);
bool set_use_margins = false;
- int set_sub_pos = 0;
+ float set_sub_pos = 0.0f;
float set_line_spacing = 0;
float set_font_scale = 1;
int set_hinting = 0;
@@ -406,7 +406,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
set_use_margins = opts->ass_use_margins;
}
if (converted || opts->ass_style_override) {
- set_sub_pos = 100 - opts->sub_pos;
+ set_sub_pos = 100.0f - opts->sub_pos;
set_line_spacing = opts->ass_line_spacing;
set_hinting = opts->ass_hinting;
set_font_scale = opts->sub_scale;