summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-01-23 11:02:04 +0000
committerCarl Hetherington <cth@carlh.net>2017-01-23 11:02:04 +0000
commit2163c97965b8e31ac1af28cfa8c80cf2ed85f31e (patch)
treec5771900a16fba2ab4f4123d6ec4c6e783946124
parentd45d27de54e27fae88d13d9bcee5e820e0dc59ba (diff)
Fix failure to parse subrip where there are extra spaces in the time/position line.
-rw-r--r--src/subrip_reader.cc2
-rw-r--r--test/subrip_reader_test.cc1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc
index 6fab0ff..45da3ab 100644
--- a/src/subrip_reader.cc
+++ b/src/subrip_reader.cc
@@ -113,7 +113,7 @@ SubripReader::read (function<optional<string> ()> get_line)
/* Further trim this line, removing spaces from the end */
trim_right_if (*line, boost::is_any_of (" "));
- boost::algorithm::split (p, *line, boost::algorithm::is_any_of (" "));
+ boost::algorithm::split (p, *line, boost::algorithm::is_any_of (" "), boost::token_compress_on);
if (p.size() != 3 && p.size() != 7) {
for (int i = 0; i < 2; ++i) {
optional<string> ex = get_line ();
diff --git a/test/subrip_reader_test.cc b/test/subrip_reader_test.cc
index 58cf46b..604f52a 100644
--- a/test/subrip_reader_test.cc
+++ b/test/subrip_reader_test.cc
@@ -379,6 +379,7 @@ BOOST_AUTO_TEST_CASE (subrip_read_test)
test ("sintel_fr.srt");
test ("Fight.Club.1999.720p.BRRip.x264-x0r.srt");
test ("EU13.srt");
+ test ("Subtitulos_HURTO_eng.srt");
}
#define SUB_START(f, t) \