diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-21 15:16:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-21 15:16:18 +0100 |
| commit | cbd4450197a083bf58bda510e626f73ba583cb66 (patch) | |
| tree | 2be308772512539570beab36beab02bde72d6d4b /src/lib/dcp_examiner.cc | |
| parent | 1013175d5f6adfa0e6a7442e4c9aebb893787748 (diff) | |
Basics of multiple captions per content so that DCPContent can
hold subs and closed captions.
Diffstat (limited to 'src/lib/dcp_examiner.cc')
| -rw-r--r-- | src/lib/dcp_examiner.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index c097877a3..8ce4aee00 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -39,6 +39,7 @@ #include <dcp/sound_asset_reader.h> #include <dcp/subtitle_asset.h> #include <dcp/reel_subtitle_asset.h> +#include <dcp/reel_closed_caption_asset.h> #include <dcp/sound_asset.h> #include <boost/foreach.hpp> #include <iostream> @@ -57,7 +58,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) , _audio_length (0) , _has_video (false) , _has_audio (false) - , _has_subtitles (false) + , _captions (0) , _encrypted (false) , _needs_assets (false) , _kdm_valid (false) @@ -165,7 +166,17 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) return; } - _has_subtitles = true; + ++_captions; + } + + if (i->closed_caption ()) { + if (!i->closed_caption()->asset_ref().resolved()) { + /* We are missing this asset so we can't continue; examination will be repeated later */ + _needs_assets = true; + return; + } + + ++_captions; } if (i->main_picture()) { @@ -174,6 +185,8 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content) _reel_lengths.push_back (i->main_sound()->duration()); } else if (i->main_subtitle()) { _reel_lengths.push_back (i->main_subtitle()->duration()); + } else if (i->closed_caption()) { + _reel_lengths.push_back (i->closed_caption()->duration()); } } |
