Fix recognition of MXF-wrapped subtitle content vs audio/video.
authorCarl Hetherington <cth@carlh.net>
Wed, 21 Jan 2015 19:37:16 +0000 (19:37 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 21 Jan 2015 19:37:16 +0000 (19:37 +0000)
ChangeLog
cscript
src/lib/content_factory.cc

index bf61112dab8c41694e88c0b7d25d0b65bc7f60c9..d437647ed9e3c99a1b16d61915f215510a734d43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-21  Carl Hetherington  <cth@carlh.net>
+
+       * Fix differentiation between MXF-wrapped subtitles
+       and video/audio content.
+
 2015-01-20  Carl Hetherington  <cth@carlh.net>
 
        * Version 2.0.35 released.
diff --git a/cscript b/cscript
index 2486e18a2b2767fc838e619cb920baa01993c2b6..2fcfe454d96ea2367ca0c124cf29de3bbf81df1a 100644 (file)
--- a/cscript
+++ b/cscript
@@ -156,7 +156,7 @@ def make_control(debian_version, bits, filename, debug):
 
 def dependencies(target):
     return (('ffmpeg-cdist', 'f69bb08'),
-            ('libdcp', '5b519d9'),
+            ('libdcp', 'a8d0450'),
             ('libsub', 'f66b11f'))
 
 def build(target, options):
index ed00639a08fab7e342edeffe830f753803cda3ae..f4d9fe4e93f7734679a7e9145af58a227f8fb37b 100644 (file)
@@ -29,6 +29,7 @@
 #include "dcp_subtitle_content.h"
 #include "util.h"
 #include <libcxml/cxml.h>
+#include <dcp/smpte_subtitle_content.h>
 
 using std::string;
 using std::list;
@@ -86,15 +87,8 @@ 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 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 (...) {
-
-               }
+       } else if (ext == ".mxf" && dcp::SMPTESubtitleContent::valid_mxf (path)) {
+               content.reset (new DCPSubtitleContent (film, path));
        }
 
        if (!content) {