summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-25 01:03:59 +0200
committerwm4 <wm4@nowhere>2016-09-25 01:03:59 +0200
commit077dd27df2df51bf0fadf8dcfd1cd5c523b895e6 (patch)
treedd6b22a35ecccbb015fed37cb3327e2c25312f01
parentcad6fb038b477865581109ab99dc79ad4b50e79f (diff)
downloadmpv-077dd27df2df51bf0fadf8dcfd1cd5c523b895e6.tar.bz2
mpv-077dd27df2df51bf0fadf8dcfd1cd5c523b895e6.tar.xz
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.
-rw-r--r--sub/sd_ass.c7
1 files changed, 4 insertions, 3 deletions
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);
}