summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-02 22:42:26 +0200
committerwm4 <wm4@nowhere>2012-10-16 07:26:31 +0200
commit5357b38d40e28dda4032ddc8654f5877d4928860 (patch)
treea1a888e4e0d9829b435332d6008bd46ecbede4f9 /sub
parent42572fdcc0931f814147974a11bc2c531843d124 (diff)
downloadmpv-5357b38d40e28dda4032ddc8654f5877d4928860.tar.bz2
mpv-5357b38d40e28dda4032ddc8654f5877d4928860.tar.xz
osd_libass: set RTL base direction to neutral
We are using libass for OSD rendering. One problem with that is that libass has to be bug-compatible to VSFilter. This includes the setting for the default RTL base direction. Neutral would be most reasonable, but VSFilter assumes LTR. This commit forces the default to neutral. Unconfirmed whether this actually works as intended. See the following libass commits: 9dbd12d shaper: allow font encoding -1 for neutral base direction a80c45c shaper: always use LTR base direction by default
Diffstat (limited to 'sub')
-rw-r--r--sub/osd_libass.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index dee60c7df7..811bc009f3 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -59,8 +59,11 @@ void osd_destroy_backend(struct osd_state *osd)
osd->osd_ass_library = NULL;
}
-static void update_font_scale(ASS_Track *track, ASS_Style *style, double factor)
+static void update_font_style(ASS_Track *track, ASS_Style *style, double factor)
{
+ // Set to neutral base direction, as opposed to VSFilter LTR default
+ style->Encoding = -1;
+
// duplicated from ass_mp.c
double fs = track->PlayResY * factor / 100.;
/* The font size is always proportional to video height only;
@@ -86,7 +89,7 @@ static ASS_Track *create_osd_ass_track(struct osd_state *osd)
track->PlayResX = track->PlayResY * 1.33333;
- update_font_scale(track, style, text_font_scale_factor);
+ update_font_style(track, style, text_font_scale_factor);
style->Alignment = 5;
@@ -243,7 +246,7 @@ static void update_sub(struct osd_state *osd, struct osd_object *obj)
ASS_Style *style = obj->osd_track->styles + obj->osd_track->default_style;
style->MarginV = obj->osd_track->PlayResY * ((100 - sub_pos)/110.0);
- update_font_scale(obj->osd_track, style, text_font_scale_factor);
+ update_font_style(obj->osd_track, style, text_font_scale_factor);
char *text = talloc_strdup(NULL, "");