summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
Diffstat (limited to 'sub')
-rw-r--r--sub/ass_mp.c2
-rw-r--r--sub/ass_mp.h2
-rw-r--r--sub/osd_libass.c7
3 files changed, 8 insertions, 3 deletions
diff --git a/sub/ass_mp.c b/sub/ass_mp.c
index 33cd1559fc..72c22d54e6 100644
--- a/sub/ass_mp.c
+++ b/sub/ass_mp.c
@@ -39,7 +39,7 @@
// res_y should be track->PlayResY
// It determines scaling of font sizes and more.
-void mp_ass_set_style(ASS_Style *style, int res_y,
+void mp_ass_set_style(ASS_Style *style, double res_y,
const struct osd_style_opts *opts)
{
if (opts->font) {
diff --git a/sub/ass_mp.h b/sub/ass_mp.h
index 27d09d8acd..987efdfe28 100644
--- a/sub/ass_mp.h
+++ b/sub/ass_mp.h
@@ -44,7 +44,7 @@ struct MPOpts;
struct mp_osd_res;
struct osd_style_opts;
-void mp_ass_set_style(ASS_Style *style, int res_y,
+void mp_ass_set_style(ASS_Style *style, double res_y,
const struct osd_style_opts *opts);
void mp_ass_add_default_styles(ASS_Track *track, struct MPOpts *opts);
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);