summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-08-18 16:20:34 +0300
committeravih <avih@users.noreply.github.com>2021-08-19 15:39:07 +0300
commitc7cdd38ac99882d3e41a26f275c920886df3569b (patch)
treebc4d9d12cbbb7b4f99c1660b056c651d269c9600 /sub/osd_libass.c
parent6193f723b0aa234bfb5c869d9e2af67b0df0dfef (diff)
downloadmpv-c7cdd38ac99882d3e41a26f275c920886df3569b.tar.bz2
mpv-c7cdd38ac99882d3e41a26f275c920886df3569b.tar.xz
osd_libass: disable --osd-back-color for the progress bar
This breaks the rendering in various ways, so first workaround is to simply disable the opaque box for the bar. Next commit will add an artificial background box.
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 667431eb7b..917bf2649c 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -367,6 +367,14 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj,
mp_ass_set_style(style, track->PlayResY, opts->osd_style);
+ if (osd->opts->osd_style->back_color.a) {
+ // override the default osd opaque-box into plain outline. Otherwise
+ // the opaque box is not aligned with the bar (even without shadow),
+ // and each bar ass event gets its own opaque box - breaking the bar.
+ style->BackColour = MP_ASS_COLOR(opts->osd_style->shadow_color);
+ style->BorderStyle = 1; // outline
+ }
+
*o_w = track->PlayResX * (opts->osd_bar_w / 100.0);
*o_h = track->PlayResY * (opts->osd_bar_h / 100.0);