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
This commit is contained in:
wm4 2012-10-02 22:42:26 +02:00
parent 42572fdcc0
commit 5357b38d40
1 changed files with 6 additions and 3 deletions

View File

@ -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, "");