summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-26 01:00:16 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-26 01:00:16 +0100
commit53f0390517bbc62401cee85f8ad28754d07a6749 (patch)
treed53a0955ed98f0bd72e74f9cd407b11a2d8efe52 /src
parent23a1a0395b31c4dc36d65531d02b7df240a25dce (diff)
Fix coalesced override codes (\i1\b1 and such).
Diffstat (limited to 'src')
-rw-r--r--src/ssa_reader.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc
index 93e96f2..05c908e 100644
--- a/src/ssa_reader.cc
+++ b/src/ssa_reader.cc
@@ -230,7 +230,7 @@ SSAReader::parse_line (RawSubtitle base, string line)
}
break;
case STYLE:
- if (c == '}') {
+ if (c == '}' || c == '\\') {
if (!current.text.empty ()) {
subs.push_back (current);
current.text = "";
@@ -250,7 +250,11 @@ SSAReader::parse_line (RawSubtitle base, string line)
} else if (style == "\\an7" || style == "\\an8" || style == "\\an9") {
current.vertical_position.reference = sub::TOP_OF_SCREEN;
}
+
style = "";
+ }
+
+ if (c == '}') {
state = TEXT;
} else {
style += c;