1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 21:06:00 +00:00

sub/ass: use default style, not first style unconditionally

Turns out it's a bad idea to just always unconditionally use the first
style. Make mplayer2 use and set the style according to the track's
default_style property. Fixes the -ass-styles option broken with
recent libass versions (ticket #40).
This commit is contained in:
Grigori Goronzy 2011-05-30 20:57:58 +02:00 committed by Uoti Urpala
parent 17db5cc98f
commit 378ada847c

View File

@ -85,6 +85,7 @@ ASS_Track *mp_ass_default_track(ASS_Library *library)
if (track->n_styles == 0) {
track->Kerning = true;
int sid = ass_alloc_style(track);
track->default_style = sid;
ASS_Style *style = track->styles + sid;
style->Name = strdup("Default");
style->FontName = (font_fontconfig >= 0
@ -166,7 +167,7 @@ static int ass_process_subtitle(ASS_Track *track, subtitle *sub)
event->Start = sub->start * 10;
event->Duration = (sub->end - sub->start) * 10;
event->Style = 0;
event->Style = track->default_style;
for (j = 0; j < sub->lines; ++j)
len += sub->text[j] ? strlen(sub->text[j]) : 0;