diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2013-12-26 04:26:43 +0200 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2014-01-07 22:59:34 +0200 |
commit | 190fb1eac04f6c0de92ceaa3c4a7e54e10ddb754 (patch) | |
tree | 3a6d866d742c318cfcbfe60ad478ffbcb4feb242 /libass/ass.c | |
parent | 9f2ffc03574ae323867fba00f8aaacc637bb0aa1 (diff) | |
download | libass-190fb1eac04f6c0de92ceaa3c4a7e54e10ddb754.tar.bz2 libass-190fb1eac04f6c0de92ceaa3c4a7e54e10ddb754.tar.xz |
A whole bunch of parsing and default value fixes
Obtained by reading the xy-VSFilter source code.
Diffstat (limited to 'libass/ass.c')
-rw-r--r-- | libass/ass.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libass/ass.c b/libass/ass.c index 31f506d8..aa492467 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -547,6 +547,11 @@ static int process_style(ASS_Track *track, char *str) INTVAL(Alignment) if (track->track_type == TRACK_TYPE_ASS) target->Alignment = numpad2align(target->Alignment); + // VSFilter compatibility + else if (target->Alignment == 8) + target->Alignment = 3; + else if (target->Alignment == 4) + target->Alignment = 11; INTVAL(MarginL) INTVAL(MarginR) INTVAL(MarginV) @@ -557,11 +562,15 @@ static int process_style(ASS_Track *track, char *str) FPVAL(Shadow) PARSE_END } - style->ScaleX /= 100.; - style->ScaleY /= 100.; + style->ScaleX = FFMAX(style->ScaleX, 0.) / 100.; + style->ScaleY = FFMAX(style->ScaleY, 0.) / 100.; + style->Spacing = FFMAX(style->Spacing, 0.); + style->Outline = FFMAX(style->Outline, 0.); + style->Shadow = FFMAX(style->Shadow, 0.); style->Bold = !!style->Bold; style->Italic = !!style->Italic; style->Underline = !!style->Underline; + style->StrikeOut = !!style->StrikeOut; if (!style->Name) style->Name = strdup("Default"); if (!style->FontName) |