CCAP fixes.
authorCarl Hetherington <cth@carlh.net>
Wed, 6 Sep 2017 20:58:15 +0000 (21:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 6 Sep 2017 20:58:15 +0000 (21:58 +0100)
src/cpl.cc
src/reel.cc
src/reel.h

index c53b8e95d08992f9aed652c5192953eff0cc90d2..f807bc61c5cf00672b7e8ca2cf5d15b1db9e2860 100644 (file)
@@ -40,6 +40,7 @@
 #include "reel_picture_asset.h"
 #include "reel_sound_asset.h"
 #include "reel_subtitle_asset.h"
+#include "reel_closed_caption_asset.h"
 #include "reel_atmos_asset.h"
 #include "local_time.h"
 #include "dcp_assert.h"
@@ -188,6 +189,9 @@ CPL::reel_assets () const
                if (i->main_subtitle ()) {
                        c.push_back (i->main_subtitle());
                }
+               if (i->closed_caption ()) {
+                       c.push_back (i->closed_caption());
+               }
                if (i->atmos ()) {
                        c.push_back (i->atmos());
                }
index 1804f3dcdd5a5a7bb106bb8a6bf310d198a9a4fe..a159ce74b7b7e6e57889bf87b248f38b10184c8d 100644 (file)
@@ -49,6 +49,7 @@
 #include "reel_atmos_asset.h"
 #include "reel_closed_caption_asset.h"
 #include <libxml++/nodes/element.h>
+#include <boost/foreach.hpp>
 
 using std::string;
 using std::list;
@@ -84,11 +85,10 @@ Reel::Reel (boost::shared_ptr<const cxml::Node> node)
        }
 
        /* XXX: it's not ideal that we silently tolerate Interop or SMPTE nodes here */
-       shared_ptr<cxml::Node> closed_caption = asset_list->optional_node_child ("cc-cpl:MainClosedCaption");
-       if (closed_caption) {
-               _closed_caption.reset (new ReelClosedCaptionAsset (closed_caption));
+       shared_ptr<cxml::Node> closed_caption = asset_list->optional_node_child ("MainClosedCaption");
+       if (!closed_caption) {
+               closed_caption = asset_list->optional_node_child ("ClosedCaption");
        }
-       closed_caption = asset_list->optional_node_child ("tt:ClosedCaption");
        if (closed_caption) {
                _closed_caption.reset (new ReelClosedCaptionAsset (closed_caption));
        }
index 193da52f1a5183719befae4084a6f79e9612cbcb..238ec3e0564b0ad53dfcb199a5a52beb32ff4352 100644 (file)
@@ -92,6 +92,10 @@ public:
                return _main_subtitle;
        }
 
+       boost::shared_ptr<ReelClosedCaptionAsset> closed_caption () const {
+               return _closed_caption;
+       }
+
        boost::shared_ptr<ReelAtmosAsset> atmos () const {
                return _atmos;
        }