diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-02 20:06:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-02 20:06:36 +0100 |
| commit | a06e701131b813bc42ae81b9c5e8c7dbbfea7eb9 (patch) | |
| tree | 6ec5ea6b3e3354111d2670e464ddc47909bacd7f /src | |
| parent | 6bd500ef1f482530d38f2b570885e9c53e6a0e79 (diff) | |
Fix errors with SSA subtitles containing commas.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ssa_reader.cc | 9 |
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()); |
