summaryrefslogtreecommitdiff
path: root/src/lib/content_factory.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-04 01:13:13 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-04 01:13:13 +0000
commit8af00f5e0862c18e8c7b5f9ac0ea95a5d6ad696c (patch)
tree925d0673ec1c3319a8cc85374acb14a27d555c60 /src/lib/content_factory.cc
parenta5095486e606adfe36de635a48710cf98872c1c6 (diff)
Fix loading of SMPTE subtitles that are not MXF-wrapped.
Diffstat (limited to 'src/lib/content_factory.cc')
-rw-r--r--src/lib/content_factory.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index de940d025..ed00639a0 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -77,7 +77,7 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
string ext = path.extension().string ();
transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
-
+
if (valid_image_file (path)) {
content.reset (new ImageContent (film, path));
} else if (SndfileContent::valid_file (path)) {
@@ -86,7 +86,18 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path)
content.reset (new SubRipContent (film, path));
} else if (ext == ".xml") {
content.reset (new DCPSubtitleContent (film, path));
- } else {
+ } else if (ext == ".mxf") {
+ /* Try to read this .mxf as a subtitle file; if we fail, we fall back
+ to using FFmpeg below.
+ */
+ try {
+ content.reset (new DCPSubtitleContent (film, path));
+ } catch (...) {
+
+ }
+ }
+
+ if (!content) {
content.reset (new FFmpegContent (film, path));
}