summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-19 21:57:58 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-19 21:57:58 +0100
commit6825d70ae8310faa064c8d39cb20c77d5d02c8b9 (patch)
treec0071aceffe824db91cb30df82b8f5bd3287b745 /src
parent3622680ecd0f502625ac61ab8477e1a7fd9b06f4 (diff)
Fix some small errors in SSA/ASS parsing.
Diffstat (limited to 'src')
-rw-r--r--src/ssa_reader.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc
index c1614a8..74d497a 100644
--- a/src/ssa_reader.cc
+++ b/src/ssa_reader.cc
@@ -316,9 +316,9 @@ SSAReader::read (function<optional<string> ()> get_line)
size_t const colon = line->find (":");
SUB_ASSERT (colon != string::npos);
- SUB_ASSERT (line->length() > colon + 1);
string const type = line->substr (0, colon);
- string const body = line->substr (colon + 2);
+ string body = line->substr (colon + 1);
+ trim (body);
switch (part) {
case INFO:
@@ -367,6 +367,10 @@ SSAReader::read (function<optional<string> ()> get_line)
} else if (event_format[i] == "End") {
sub.to = parse_time (event[i]);
} else if (event_format[i] == "Style") {
+ /* libass trims leading '*'s from style names, commenting that
+ "they seem to mean literally nothing". Go figure...
+ */
+ trim_left_if (event[i], boost::is_any_of ("*"));
SUB_ASSERT (styles.find(event[i]) != styles.end());
Style style = styles[event[i]];
sub.font = style.font_name;