From: Carl Hetherington Date: Sun, 13 Nov 2022 23:39:25 +0000 (+0100) Subject: Fix WebVTT milliseconds separator (should be . it seems, not ,) X-Git-Tag: v1.6.39 X-Git-Url: https://main.carlh.net/gitweb/?p=libsub.git;a=commitdiff_plain;h=8ff50a18013d3c57d1058368146c979354016663 Fix WebVTT milliseconds separator (should be . it seems, not ,) --- diff --git a/src/web_vtt_reader.cc b/src/web_vtt_reader.cc index 2e772f1..cd6844d 100644 --- a/src/web_vtt_reader.cc +++ b/src/web_vtt_reader.cc @@ -111,13 +111,13 @@ WebVTTReader::read(std::function ()> get_line) } string expected; - auto from = SubripReader::convert_time(parts[0], &expected); + auto from = SubripReader::convert_time(parts[0], ".", &expected); if (!from) { throw WebVTTError(parts[0], expected, _context); } rs.from = *from; - auto to = SubripReader::convert_time(parts[2], &expected); + auto to = SubripReader::convert_time(parts[2], ".", &expected); if (!to) { throw WebVTTError(parts[2], expected, _context); } diff --git a/test/data/test.vtt b/test/data/test.vtt index 6cd60eb..15475d4 100644 --- a/test/data/test.vtt +++ b/test/data/test.vtt @@ -5,9 +5,9 @@ Seem: to put stuff here NOTE You can have notes That span multiple lines -00:00:41,090 --> 00:00:42,210 +00:00:41.090 --> 00:00:42.210 This is a subtitle and that's a line break -00:01:01,010 --> 00:01:02,100 +00:01:01.010 --> 00:01:02.100 This is some stuff.