Fix failure to parse subrip where there are extra spaces in the time/position line.
authorCarl Hetherington <cth@carlh.net>
Mon, 23 Jan 2017 11:02:04 +0000 (11:02 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 23 Jan 2017 11:02:04 +0000 (11:02 +0000)
src/subrip_reader.cc
test/subrip_reader_test.cc

index 6fab0ffcbdcfed813a7207dbbcda35d513daa115..45da3ab949d4324767b3068ca65d19a1c512b1a9 100644 (file)
@@ -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 ();
index 58cf46ba40f596e4921dd8edda5096e3406b37d4..604f52a364fecf1678b686575f7d1e7d8f947135 100644 (file)
@@ -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) \