X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fwriter.cc;h=a9700f4f5edbbb7272e2ed2735c56f74cd2535b3;hp=0b1d8e06d08d3604ec6848c8ff95e3344c2f577c;hb=4347d97b703cfddcd322051092ccfcd5b5a6b941;hpb=d97029163865e212dc3d7b3c57c16459933a11f6 diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 0b1d8e06d..a9700f4f5 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -62,7 +62,11 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif using dcp::Data; +using dcp::ArrayData; using namespace dcpomatic; Writer::Writer (shared_ptr film, weak_ptr j) @@ -127,7 +131,7 @@ Writer::~Writer () * @param eyes Eyes that this frame image is for. */ void -Writer::write (Data encoded, Frame frame, Eyes eyes) +Writer::write (shared_ptr encoded, Frame frame, Eyes eyes) { boost::mutex::scoped_lock lock (_state_mutex); @@ -423,7 +427,7 @@ try case QueueItem::FULL: LOG_DEBUG_ENCODE (N_("Writer FULL-writes %1 (%2)"), qi.frame, (int) qi.eyes); if (!qi.encoded) { - qi.encoded = Data (_film->j2c_path (qi.reel, qi.frame, qi.eyes, false)); + qi.encoded.reset (new ArrayData(_film->j2c_path(qi.reel, qi.frame, qi.eyes, false))); } reel.write (qi.encoded, qi.frame, qi.eyes); ++_full_written; @@ -599,10 +603,10 @@ Writer::finish () cpl->set_luminance (_film->luminance()); list ac = _film->mapped_audio_channels (); - dcp::MainSoundConfiguration::Field field = ( + dcp::MCASoundField field = ( find(ac.begin(), ac.end(), static_cast(dcp::BSL)) != ac.end() || find(ac.begin(), ac.end(), static_cast(dcp::BSR)) != ac.end() - ) ? dcp::MainSoundConfiguration::SEVEN_POINT_ONE : dcp::MainSoundConfiguration::FIVE_POINT_ONE; + ) ? dcp::SEVEN_POINT_ONE : dcp::FIVE_POINT_ONE; dcp::MainSoundConfiguration msc (field, _film->audio_channels()); BOOST_FOREACH (int i, ac) { @@ -616,6 +620,11 @@ Writer::finish () cpl->set_main_picture_stored_area (_film->frame_size()); cpl->set_main_picture_active_area (_film->active_area()); + vector sl = _film->subtitle_languages(); + if (sl.size() > 1) { + cpl->set_additional_subtitle_languages(std::vector(sl.begin() + 1, sl.end())); + } + shared_ptr signer; signer = Config::instance()->signer_chain (); /* We did check earlier, but check again here to be on the safe side */ @@ -656,15 +665,12 @@ Writer::write_cover_sheet () boost::algorithm::replace_all (text, "$CONTAINER", _film->container()->container_nickname()); boost::algorithm::replace_all (text, "$AUDIO_LANGUAGE", _film->isdcf_metadata().audio_language); - optional subtitle_language; - BOOST_FOREACH (shared_ptr i, _film->content()) { - BOOST_FOREACH (shared_ptr j, i->text) { - if (j->type() == TEXT_OPEN_SUBTITLE && j->use()) { - subtitle_language = j->language (); - } - } + vector subtitle_languages = _film->subtitle_languages(); + if (subtitle_languages.empty()) { + boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", "None"); + } else { + boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_languages.front().description()); } - boost::algorithm::replace_all (text, "$SUBTITLE_LANGUAGE", subtitle_language.get_value_or("None")); boost::uintmax_t size = 0; for (