From 53f0390517bbc62401cee85f8ad28754d07a6749 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Jun 2016 01:00:16 +0100 Subject: Fix coalesced override codes (\i1\b1 and such). --- src/ssa_reader.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3