summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-11-14 00:32:33 +0100
committerCarl Hetherington <cth@carlh.net>2022-11-14 00:32:33 +0100
commitdb4a3dbc4aa4cdcffb96c67b8f6d4d68c5467933 (patch)
treef69790c382d03d37569bdf0ab2650d4a73f69300
parent09512a7cb428ddb7e092a67697aebcf422f8dba1 (diff)
Be more tolerant of metadata in WebVTT.
-rw-r--r--src/web_vtt_reader.cc4
-rw-r--r--test/data/test.vtt2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/web_vtt_reader.cc b/src/web_vtt_reader.cc
index 2781654..2e772f1 100644
--- a/src/web_vtt_reader.cc
+++ b/src/web_vtt_reader.cc
@@ -55,7 +55,7 @@ WebVTTReader::read(std::function<optional<string> ()> get_line)
enum class State {
/* expecting WEBVTT */
HEADER,
- /* awaiting a NOTE or a subtitle timing line */
+ /* awaiting a NOTE, some other metadata, or a subtitle timing line */
DATA,
/* reading the text of a subtitle */
SUBTITLE,
@@ -125,8 +125,6 @@ WebVTTReader::read(std::function<optional<string> ()> get_line)
rs.vertical_position.line = 0;
state = State::SUBTITLE;
- } else if (!line->empty()) {
- throw WebVTTError(*line, "a note or time", _context);
}
break;
case State::SUBTITLE:
diff --git a/test/data/test.vtt b/test/data/test.vtt
index 461c8a2..6cd60eb 100644
--- a/test/data/test.vtt
+++ b/test/data/test.vtt
@@ -1,4 +1,6 @@
WEBVTT - you can put something here
+Some: people
+Seem: to put stuff here
NOTE You can have notes
That span multiple lines