summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 0564fbb4d3..71255256a9 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -163,8 +163,13 @@ static void update_osd(struct osd_state *osd, struct osd_object *obj)
struct osd_style_opts font = *opts->osd_style;
font.font_size *= opts->osd_scale;
+ double playresy = obj->osd_track->PlayResY;
+ // Compensate for libass and mp_ass_set_style scaling the font etc.
+ if (!opts->osd_scale_by_window)
+ playresy *= 720.0 / obj->vo_res.h;
+
ASS_Style *style = obj->osd_track->styles + obj->osd_track->default_style;
- mp_ass_set_style(style, obj->osd_track->PlayResY, &font);
+ mp_ass_set_style(style, playresy, &font);
char *text = mangle_ass(osd->osd_text);
add_osd_ass_event(obj->osd_track, text);