projects
/
libsub.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Throw a specific exception when no WEBVTT header is found.
[libsub.git]
/
src
/
web_vtt_reader.cc
diff --git
a/src/web_vtt_reader.cc
b/src/web_vtt_reader.cc
index 2e772f143b99a8e65cdd0de325e500758faf9af3..4618466575fc471f3cc367948f3ef5b5fbdba554 100644
(file)
--- a/
src/web_vtt_reader.cc
+++ b/
src/web_vtt_reader.cc
@@
-86,7
+86,7
@@
WebVTTReader::read(std::function<optional<string> ()> get_line)
switch (state) {
case State::HEADER:
if (!boost::starts_with(*line, "WEBVTT")) {
switch (state) {
case State::HEADER:
if (!boost::starts_with(*line, "WEBVTT")) {
- throw WebVTT
Error("No WEBVTT header found"
);
+ throw WebVTT
HeaderError(
);
}
state = State::DATA;
break;
}
state = State::DATA;
break;
@@
-111,13
+111,13
@@
WebVTTReader::read(std::function<optional<string> ()> get_line)
}
string expected;
}
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;
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);
}
if (!to) {
throw WebVTTError(parts[2], expected, _context);
}