X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcontent_factory.cc;h=3c65b43129a14a23d62628a8f14a1911495b4ec8;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=16340adb43b0e74f8f14d4b2bc039e258d8e58a9;hpb=e491397c0028a80ac4a48a92007f783746553c1a;p=dcpomatic.git diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index 16340adb4..3c65b4312 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -21,7 +21,6 @@ * @brief Methods to create content objects. */ -#include #include "ffmpeg_content.h" #include "image_content.h" #include "sndfile_content.h" @@ -29,6 +28,8 @@ #include "dcp_content.h" #include "dcp_subtitle_content.h" #include "util.h" +#include +#include using std::string; using std::list; @@ -47,7 +48,7 @@ content_factory (shared_ptr film, cxml::NodePtr node, int version, l string const type = node->string_child ("Type"); boost::shared_ptr content; - + if (type == "FFmpeg") { content.reset (new FFmpegContent (film, node, version, notes)); } else if (type == "Image") { @@ -77,7 +78,7 @@ content_factory (shared_ptr 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 +87,11 @@ content_factory (shared_ptr 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" && dcp::SMPTESubtitleAsset::valid_mxf (path)) { + content.reset (new DCPSubtitleContent (film, path)); + } + + if (!content) { content.reset (new FFmpegContent (film, path)); }