From: Carl Hetherington Date: Wed, 6 Sep 2017 20:58:15 +0000 (+0100) Subject: CCAP fixes. X-Git-Tag: v1.5.0~36 X-Git-Url: https://main.carlh.net/gitweb/?p=libdcp.git;a=commitdiff_plain;h=0c82e61b2c6177c91a1a80caf6819e36728c004f CCAP fixes. --- diff --git a/src/cpl.cc b/src/cpl.cc index c53b8e95..f807bc61 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -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()); } diff --git a/src/reel.cc b/src/reel.cc index 1804f3dc..a159ce74 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -49,6 +49,7 @@ #include "reel_atmos_asset.h" #include "reel_closed_caption_asset.h" #include +#include using std::string; using std::list; @@ -84,11 +85,10 @@ Reel::Reel (boost::shared_ptr node) } /* XXX: it's not ideal that we silently tolerate Interop or SMPTE nodes here */ - shared_ptr closed_caption = asset_list->optional_node_child ("cc-cpl:MainClosedCaption"); - if (closed_caption) { - _closed_caption.reset (new ReelClosedCaptionAsset (closed_caption)); + shared_ptr 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)); } diff --git a/src/reel.h b/src/reel.h index 193da52f..238ec3e0 100644 --- a/src/reel.h +++ b/src/reel.h @@ -92,6 +92,10 @@ public: return _main_subtitle; } + boost::shared_ptr closed_caption () const { + return _closed_caption; + } + boost::shared_ptr atmos () const { return _atmos; }