summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-11-14 00:26:48 +0100
committerCarl Hetherington <cth@carlh.net>2022-11-14 00:39:51 +0100
commite82c83b35e7638957f3d80b12d4c59c17436473a (patch)
tree3f9e7345f752993985dd65b140dc9ed7545b4a0a
parentc2f74bf15f6f2a88138119a42a44f4241169f6e5 (diff)
Basic WebVTT subtitle support (#1361).
-rw-r--r--cscript2
-rw-r--r--src/lib/content_factory.cc2
-rw-r--r--src/lib/string_text_file.cc3
3 files changed, 5 insertions, 2 deletions
diff --git a/cscript b/cscript
index b4de45028..a3fcc8c53 100644
--- a/cscript
+++ b/cscript
@@ -452,7 +452,7 @@ def dependencies(target, options):
deps = []
deps.append(('libdcp', 'v1.8.33'))
- deps.append(('libsub', 'v1.6.37'))
+ deps.append(('libsub', 'v1.6.39'))
deps.append(('leqm-nrt', '93ae9e6'))
deps.append(('rtaudio', 'f619b76'))
# We get our OpenSSL libraries from the environment, but we
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index 135f3fe5f..5f1e6c9b7 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -167,7 +167,7 @@ content_factory (boost::filesystem::path path)
if (valid_image_file (path)) {
single = make_shared<ImageContent>(path);
- } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass" || ext == ".stl") {
+ } else if (ext == ".srt" || ext == ".ssa" || ext == ".ass" || ext == ".stl" || ext == ".vtt") {
single = make_shared<StringTextFileContent>(path);
} else if (ext == ".xml") {
cxml::Document doc;
diff --git a/src/lib/string_text_file.cc b/src/lib/string_text_file.cc
index 76abe547f..869a2c96a 100644
--- a/src/lib/string_text_file.cc
+++ b/src/lib/string_text_file.cc
@@ -28,6 +28,7 @@
#include <sub/ssa_reader.h>
#include <sub/stl_binary_reader.h>
#include <sub/subrip_reader.h>
+#include <sub/web_vtt_reader.h>
#include <unicode/ucsdet.h>
#include <unicode/ucnv.h>
#include <iostream>
@@ -105,6 +106,8 @@ StringTextFile::StringTextFile (shared_ptr<const StringTextFileContent> content)
reader.reset(new sub::SubripReader(utf8.get()));
} else if (ext == ".ssa" || ext == ".ass") {
reader.reset(new sub::SSAReader(utf8.get()));
+ } else if (ext == ".vtt") {
+ reader.reset(new sub::WebVTTReader(utf8.get()));
}
}