summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-02 20:06:36 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-02 20:06:36 +0100
commita06e701131b813bc42ae81b9c5e8c7dbbfea7eb9 (patch)
tree6ec5ea6b3e3354111d2670e464ddc47909bacd7f /src
parent6bd500ef1f482530d38f2b570885e9c53e6a0e79 (diff)
Fix errors with SSA subtitles containing commas.
Diffstat (limited to 'src')
-rw-r--r--src/ssa_reader.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ssa_reader.cc b/src/ssa_reader.cc
index 859a00e..c76a78d 100644
--- a/src/ssa_reader.cc
+++ b/src/ssa_reader.cc
@@ -274,6 +274,15 @@ SSAReader::read (function<optional<string> ()> get_line)
vector<string> event;
split (event, body, is_any_of (","));
+ /* There may be commas in the subtitle part; reassemble any extra parts
+ from when we just split it.
+ */
+ while (event.size() > event_format.size()) {
+ string const ex = event.back ();
+ event.pop_back ();
+ event.back() += "," + ex;
+ }
+
SUB_ASSERT (!event.empty());
SUB_ASSERT (event_format.size() == event.size());