summaryrefslogtreecommitdiffstats
path: root/sub/sd_lavc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r--sub/sd_lavc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c
index ef46521f0b..4620c8bd9b 100644
--- a/sub/sd_lavc.c
+++ b/sub/sd_lavc.c
@@ -465,6 +465,22 @@ static void get_bitmaps(struct sd *sd, struct mp_osd_res d, int format,
}
osd_rescale_bitmaps(res, w, h, d, video_par);
+
+ if (opts->sub_scale != 1.0 && opts->ass_style_override) {
+ for (int n = 0; n < res->num_parts; n++) {
+ struct sub_bitmap *sub = &res->parts[n];
+
+ float shit = (opts->sub_scale - 1.0f) / 2;
+
+ // Fortunately VO isn't supposed to give a FUCKING FUCK about
+ // whether the sub might e.g. go outside of the screen.
+ sub->x -= sub->dw * shit;
+ sub->y -= sub->dh * shit;
+ sub->dw += sub->dw * shit * 2;
+ sub->dh += sub->dh * shit * 2;
+ }
+ }
+
}
static bool accepts_packet(struct sd *sd, double min_pts)