From 077dd27df2df51bf0fadf8dcfd1cd5c523b895e6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 25 Sep 2016 01:03:59 +0200 Subject: sd_ass: fix top alignment of secondary subtitles Secondary subtitle streams (to be shown on the top of the screen along main subtitle stream) were shown with normal alignment. This is because we tell libass to override the alignment style (a relatively recent change, see commit 2f1eb49e). This would behave differently with old libass versions too. To escape the mess, just set the alignment explicitly with an override tag instead of modifying the style. --- sub/sd_ass.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sub') diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 041b03b999..2d9024f2d7 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -598,6 +598,10 @@ static void fill_plaintext(struct sd *sd, double pts) return; bstr dst = {0}; + + if (ctx->on_top) + bstr_xappend(NULL, &dst, bstr0("{\\a6}")); + while (*text) { if (*text == '{') bstr_xappend(NULL, &dst, bstr0("\\")); @@ -618,9 +622,6 @@ static void fill_plaintext(struct sd *sd, double pts) event->Style = track->default_style; event->Text = strdup(dst.start); - if (track->default_style < track->n_styles) - track->styles[track->default_style].Alignment = ctx->on_top ? 6 : 2; - talloc_free(dst.start); } -- cgit v1.2.3