From e82c83b35e7638957f3d80b12d4c59c17436473a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 14 Nov 2022 00:26:48 +0100 Subject: [PATCH] Basic WebVTT subtitle support (#1361). --- cscript | 2 +- src/lib/content_factory.cc | 2 +- src/lib/string_text_file.cc | 3 +++ 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(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(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 #include #include +#include #include #include #include @@ -105,6 +106,8 @@ StringTextFile::StringTextFile (shared_ptr 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())); } } -- 2.30.2