From e30e83c698a866f2bea2118804683097be589cc9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 14 Nov 2022 00:38:49 +0100 Subject: [PATCH] Allow SubripReader::convert_time to take a milliseconds separator. Maybe this method should just be on its own somewhere now. --- src/subrip_reader.cc | 23 +++++++++++++---------- src/subrip_reader.h | 2 +- test/subrip_reader_test.cc | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/subrip_reader.cc b/src/subrip_reader.cc index 926511a..a59b43f 100644 --- a/src/subrip_reader.cc +++ b/src/subrip_reader.cc @@ -21,20 +21,23 @@ * @brief SubripReader class. */ -#include "subrip_reader.h" + +#include "compose.hpp" #include "exceptions.h" -#include "util.h" -#include "sub_assert.h" #include "raw_convert.h" #include "ssa_reader.h" +#include "sub_assert.h" +#include "subrip_reader.h" +#include "util.h" #include #include +#include #include #include -#include #include -#include #include +#include + using std::string; using std::vector; @@ -125,13 +128,13 @@ SubripReader::read (function ()> get_line) } string expected; - auto from = convert_time(p[0], &expected); + auto from = convert_time(p[0], ",", &expected); if (!from) { throw SubripError(p[0], expected, _context); } rs.from = *from; - auto to = convert_time(p[2], &expected); + auto to = convert_time(p[2], ",", &expected); if (!to) { throw SubripError(p[2], expected, _context); } @@ -163,7 +166,7 @@ SubripReader::read (function ()> get_line) } optional