summaryrefslogtreecommitdiff
path: root/src/lib/dcp_subtitle_content.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/dcp_subtitle_content.cc')
-rw-r--r--src/lib/dcp_subtitle_content.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc
index b285a78fe..ac8c4245b 100644
--- a/src/lib/dcp_subtitle_content.cc
+++ b/src/lib/dcp_subtitle_content.cc
@@ -38,6 +38,7 @@ using std::list;
using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
using boost::optional;
using namespace dcpomatic;
@@ -45,7 +46,9 @@ using namespace dcpomatic;
DCPSubtitleContent::DCPSubtitleContent(boost::filesystem::path path)
: Content(path)
{
- text.push_back(make_shared<TextContent>(this, TextType::OPEN_SUBTITLE, TextType::OPEN_SUBTITLE));
+ text = vector<shared_ptr<TextContent>>{make_shared<TextContent>(this, TextType::OPEN_SUBTITLE, TextType::OPEN_SUBTITLE)};
+ /* Default to turning these subtitles on */
+ only_text()->set_use(true);
}
DCPSubtitleContent::DCPSubtitleContent(cxml::ConstNodePtr node, boost::optional<boost::filesystem::path> film_directory, int version)
@@ -63,20 +66,16 @@ DCPSubtitleContent::examine(shared_ptr<const Film> film, shared_ptr<Job> job, bo
auto subtitle_asset = load(path(0));
- auto iop = dynamic_pointer_cast<dcp::InteropTextAsset>(subtitle_asset);
- auto smpte = dynamic_pointer_cast<dcp::SMPTETextAsset>(subtitle_asset);
- if (smpte) {
+ if (auto smpte = dynamic_pointer_cast<dcp::SMPTETextAsset>(subtitle_asset)) {
set_video_frame_rate(film, smpte->edit_rate().numerator);
}
boost::mutex::scoped_lock lm(_mutex);
- /* Default to turning these subtitles on */
- only_text()->set_use(true);
-
_length = ContentTime::from_seconds(subtitle_asset->latest_text_out().as_seconds());
subtitle_asset->fix_empty_font_ids();
+ only_text()->clear_fonts();
add_fonts(only_text(), subtitle_asset);
}