projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
293f82d
)
Cope with WEBVTT files named with .srt extensions.
author
Carl Hetherington
<cth@carlh.net>
Thu, 27 Apr 2023 22:13:20 +0000
(
00:13
+0200)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 27 Apr 2023 22:13:20 +0000
(
00:13
+0200)
src/lib/string_text_file.cc
patch
|
blob
|
history
diff --git
a/src/lib/string_text_file.cc
b/src/lib/string_text_file.cc
index 869a2c96a832cf1044caff7e19463b674230aaa6..348ccd1d5e7fe95c90b0687963acb576ce6d29bc 100644
(file)
--- a/
src/lib/string_text_file.cc
+++ b/
src/lib/string_text_file.cc
@@
-103,7
+103,12
@@
StringTextFile::StringTextFile (shared_ptr<const StringTextFileContent> content)
ucnv_close (to_utf8);
if (ext == ".srt") {
- reader.reset(new sub::SubripReader(utf8.get()));
+ try {
+ reader.reset(new sub::SubripReader(utf8.get()));
+ } catch (...) {
+ /* Sometimes files are have the .srt extension but are really WEBVTT */
+ reader.reset(new sub::WebVTTReader(utf8.get()));
+ }
} else if (ext == ".ssa" || ext == ".ass") {
reader.reset(new sub::SSAReader(utf8.get()));
} else if (ext == ".vtt") {