Basic WebVTT subtitle support (#1361).
authorCarl Hetherington <cth@carlh.net>
Sun, 13 Nov 2022 23:26:48 +0000 (00:26 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 13 Nov 2022 23:39:51 +0000 (00:39 +0100)
cscript
src/lib/content_factory.cc
src/lib/string_text_file.cc

diff --git a/cscript b/cscript
index b4de450283cb5b024ac9f31068eb48281a57890f..a3fcc8c53c93bbe26795303c1ecd323c7fef33e5 100644 (file)
--- 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
index 135f3fe5f5bb1da82dfbdfb16b908475b18b16f6..5f1e6c9b71b13b44cad388e4abfc906a48e35908 100644 (file)
@@ -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;
index 76abe547f35045413e1a7b945f72a939d59ea72a..869a2c96a832cf1044caff7e19463b674230aaa6 100644 (file)
@@ -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()));
                }
        }