2 Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * @brief A representation of some audio and video content, and details of
22 * how they should be presented in a DCP.
28 #include "job_manager.h"
29 #include "transcode_job.h"
30 #include "scp_dcp_job.h"
32 #include "exceptions.h"
33 #include "examine_content_job.h"
35 #include "ui_signaller.h"
38 #include "dcp_content_type.h"
42 #include "safe_stringstream.h"
43 #include "environment_info.h"
44 #include "raw_convert.h"
45 #include <libcxml/cxml.h>
47 #include <dcp/signer.h>
49 #include <dcp/local_time.h>
50 #include <dcp/decrypted_kdm.h>
51 #include <libxml++/libxml++.h>
52 #include <boost/filesystem.hpp>
53 #include <boost/algorithm/string.hpp>
54 #include <boost/lexical_cast.hpp>
55 #include <boost/foreach.hpp>
79 using boost::shared_ptr;
80 using boost::weak_ptr;
81 using boost::dynamic_pointer_cast;
82 using boost::to_upper_copy;
83 using boost::ends_with;
84 using boost::starts_with;
85 using boost::optional;
86 using boost::is_any_of;
90 #define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
91 #define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::TYPE_GENERAL);
94 * AudioMapping XML changed.
96 * Subtitle offset changed to subtitle y offset, and subtitle x offset added.
98 * Use <Scale> tag in <VideoContent> rather than <Ratio>.
102 * Subtitle X and Y scale.
104 * Bumped to 32 for 2.0 branch; some times are expressed in Times rather
107 int const Film::current_state_version = 32;
109 /** Construct a Film object in a given directory.
111 * @param dir Film directory.
114 Film::Film (boost::filesystem::path dir, bool log)
115 : _playlist (new Playlist)
116 , _use_isdcf_name (true)
117 , _dcp_content_type (Config::instance()->default_dcp_content_type ())
118 , _container (Config::instance()->default_container ())
119 , _resolution (RESOLUTION_2K)
122 , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ())
123 , _isdcf_metadata (Config::instance()->default_isdcf_metadata ())
124 , _video_frame_rate (24)
125 , _audio_channels (6)
127 , _sequence_video (true)
129 , _burn_subtitles (false)
130 , _state_version (current_state_version)
133 set_isdcf_date_today ();
135 _playlist_changed_connection = _playlist->Changed.connect (bind (&Film::playlist_changed, this));
136 _playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
138 /* Make state.directory a complete path without ..s (where possible)
139 (Code swiped from Adam Bowen on stackoverflow)
142 boost::filesystem::path p (boost::filesystem::system_complete (dir));
143 boost::filesystem::path result;
144 for (boost::filesystem::path::iterator i = p.begin(); i != p.end(); ++i) {
146 if (boost::filesystem::is_symlink (result) || result.filename() == "..") {
149 result = result.parent_path ();
151 } else if (*i != ".") {
156 set_directory (result.make_preferred ());
158 _log.reset (new FileLog (file ("log")));
160 _log.reset (new NullLog);
163 _playlist->set_sequence_video (_sequence_video);
168 for (list<boost::signals2::connection>::const_iterator i = _job_connections.begin(); i != _job_connections.end(); ++i) {
174 Film::video_identifier () const
176 DCPOMATIC_ASSERT (container ());
179 s.imbue (std::locale::classic ());
181 s << container()->id()
182 << "_" << resolution_to_string (_resolution)
183 << "_" << _playlist->video_identifier()
184 << "_" << _video_frame_rate
185 << "_" << j2k_bandwidth();
199 if (_burn_subtitles) {
210 /** @return The file to write video frame info to */
211 boost::filesystem::path
212 Film::info_file () const
214 boost::filesystem::path p;
216 p /= video_identifier ();
220 boost::filesystem::path
221 Film::internal_video_mxf_dir () const
223 return dir ("video");
226 boost::filesystem::path
227 Film::internal_video_mxf_filename () const
229 return video_identifier() + ".mxf";
232 boost::filesystem::path
233 Film::video_mxf_filename () const
235 return filename_safe_name() + "_video.mxf";
238 boost::filesystem::path
239 Film::audio_mxf_filename () const
241 return filename_safe_name() + "_audio.mxf";
244 boost::filesystem::path
245 Film::subtitle_xml_filename () const
247 return filename_safe_name() + "_subtitle.xml";
251 Film::filename_safe_name () const
253 string const n = name ();
255 for (size_t i = 0; i < n.length(); ++i) {
256 if (isalnum (n[i])) {
266 boost::filesystem::path
267 Film::audio_analysis_dir () const
269 return dir ("analysis");
272 /** Add suitable Jobs to the JobManager to create a DCP for this Film */
276 set_isdcf_date_today ();
278 if (dcp_name().find ("/") != string::npos) {
279 throw BadSettingError (_("name"), _("cannot contain slashes"));
282 environment_info (log ());
284 ContentList cl = content ();
285 for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) {
286 LOG_GENERAL ("Content: %1", (*i)->technical_summary());
288 LOG_GENERAL ("DCP video rate %1 fps", video_frame_rate());
289 LOG_GENERAL ("%1 threads", Config::instance()->num_local_encoding_threads());
290 LOG_GENERAL ("J2K bandwidth %1", j2k_bandwidth());
292 if (container() == 0) {
293 throw MissingSettingError (_("container"));
296 if (content().empty()) {
297 throw StringError (_("You must add some content to the DCP before creating it"));
300 if (dcp_content_type() == 0) {
301 throw MissingSettingError (_("content type"));
304 if (name().empty()) {
305 throw MissingSettingError (_("name"));
308 JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
311 /** Start a job to send our DCP to the configured TMS */
313 Film::send_dcp_to_tms ()
315 shared_ptr<Job> j (new SCPDCPJob (shared_from_this()));
316 JobManager::instance()->add (j);
319 shared_ptr<xmlpp::Document>
320 Film::metadata () const
322 shared_ptr<xmlpp::Document> doc (new xmlpp::Document);
323 xmlpp::Element* root = doc->create_root_node ("Metadata");
325 root->add_child("Version")->add_child_text (raw_convert<string> (current_state_version));
326 root->add_child("Name")->add_child_text (_name);
327 root->add_child("UseISDCFName")->add_child_text (_use_isdcf_name ? "1" : "0");
329 if (_dcp_content_type) {
330 root->add_child("DCPContentType")->add_child_text (_dcp_content_type->isdcf_name ());
334 root->add_child("Container")->add_child_text (_container->id ());
337 root->add_child("Resolution")->add_child_text (resolution_to_string (_resolution));
338 root->add_child("J2KBandwidth")->add_child_text (raw_convert<string> (_j2k_bandwidth));
339 _isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata"));
340 root->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate));
341 root->add_child("ISDCFDate")->add_child_text (boost::gregorian::to_iso_string (_isdcf_date));
342 root->add_child("AudioChannels")->add_child_text (raw_convert<string> (_audio_channels));
343 root->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0");
344 root->add_child("SequenceVideo")->add_child_text (_sequence_video ? "1" : "0");
345 root->add_child("Interop")->add_child_text (_interop ? "1" : "0");
346 root->add_child("BurnSubtitles")->add_child_text (_burn_subtitles ? "1" : "0");
347 root->add_child("Signed")->add_child_text (_signed ? "1" : "0");
348 root->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0");
349 root->add_child("Key")->add_child_text (_key.hex ());
350 _playlist->as_xml (root->add_child ("Playlist"));
355 /** Write state to our `metadata' file */
357 Film::write_metadata () const
359 boost::filesystem::create_directories (directory ());
360 shared_ptr<xmlpp::Document> doc = metadata ();
361 doc->write_to_file_formatted (file("metadata.xml").string ());
365 /** Read state from our metadata file.
366 * @return Notes about things that the user should know about, or empty.
369 Film::read_metadata ()
371 if (boost::filesystem::exists (file ("metadata")) && !boost::filesystem::exists (file ("metadata.xml"))) {
372 throw StringError (_("This film was created with an older version of DCP-o-matic, and unfortunately it cannot be loaded into this version. You will need to create a new Film, re-add your content and set it up again. Sorry!"));
375 cxml::Document f ("Metadata");
376 f.read_file (file ("metadata.xml"));
378 _state_version = f.number_child<int> ("Version");
379 if (_state_version > current_state_version) {
380 throw StringError (_("This film was created with a newer version of DCP-o-matic, and it cannot be loaded into this version. Sorry!"));
383 _name = f.string_child ("Name");
384 if (_state_version >= 9) {
385 _use_isdcf_name = f.bool_child ("UseISDCFName");
386 _isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata"));
387 _isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("ISDCFDate"));
389 _use_isdcf_name = f.bool_child ("UseDCIName");
390 _isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata"));
391 _isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate"));
395 optional<string> c = f.optional_string_child ("DCPContentType");
397 _dcp_content_type = DCPContentType::from_isdcf_name (c.get ());
402 optional<string> c = f.optional_string_child ("Container");
404 _container = Ratio::from_id (c.get ());
408 _resolution = string_to_resolution (f.string_child ("Resolution"));
409 _j2k_bandwidth = f.number_child<int> ("J2KBandwidth");
410 _video_frame_rate = f.number_child<int> ("VideoFrameRate");
411 _signed = f.optional_bool_child("Signed").get_value_or (true);
412 _encrypted = f.bool_child ("Encrypted");
413 _audio_channels = f.number_child<int> ("AudioChannels");
414 /* We used to allow odd numbers (and zero) channels, but it's just not worth
417 if (_audio_channels == 0) {
419 } else if ((_audio_channels % 2) == 1) {
422 _sequence_video = f.bool_child ("SequenceVideo");
423 _three_d = f.bool_child ("ThreeD");
424 _interop = f.bool_child ("Interop");
425 if (_state_version >= 32) {
426 _burn_subtitles = f.bool_child ("BurnSubtitles");
428 _key = dcp::Key (f.string_child ("Key"));
431 /* This method is the only one that can return notes (so far) */
432 _playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes);
434 /* Write backtraces to this film's directory, until another film is loaded */
435 set_backtrace_file (file ("backtrace.txt"));
441 /** Given a directory name, return its full path within the Film's directory.
442 * The directory (and its parents) will be created if they do not exist.
444 boost::filesystem::path
445 Film::dir (boost::filesystem::path d) const
447 boost::filesystem::path p;
451 boost::filesystem::create_directories (p);
456 /** Given a file or directory name, return its full path within the Film's directory.
457 * Any required parent directories will be created.
459 boost::filesystem::path
460 Film::file (boost::filesystem::path f) const
462 boost::filesystem::path p;
466 boost::filesystem::create_directories (p.parent_path ());
471 /** @return a ISDCF-compliant name for a DCP of this film */
473 Film::isdcf_name (bool if_created_now) const
477 string raw_name = name ();
479 /* Split the raw name up into words */
480 vector<string> words;
481 split (words, raw_name, is_any_of (" "));
485 /* Add each word to fixed_name */
486 for (vector<string>::const_iterator i = words.begin(); i != words.end(); ++i) {
489 /* First letter is always capitalised */
490 w[0] = toupper (w[0]);
492 /* Count caps in w */
494 for (size_t i = 0; i < w.size(); ++i) {
495 if (isupper (w[i])) {
500 /* If w is all caps make the rest of it lower case, otherwise
503 if (caps == w.size ()) {
504 for (size_t i = 1; i < w.size(); ++i) {
505 w[i] = tolower (w[i]);
509 for (size_t i = 0; i < w.size(); ++i) {
514 if (fixed_name.length() > 14) {
515 fixed_name = fixed_name.substr (0, 14);
520 if (dcp_content_type()) {
521 d << "_" << dcp_content_type()->isdcf_name();
522 d << "-" << isdcf_metadata().content_version;
525 ISDCFMetadata const dm = isdcf_metadata ();
527 if (dm.temp_version) {
531 if (dm.pre_release) {
539 if (!dm.chain.empty ()) {
540 d << "-" << dm.chain;
547 if (dm.two_d_version_of_three_d) {
551 if (!dm.mastered_luminance.empty ()) {
552 d << "-" << dm.mastered_luminance;
555 if (video_frame_rate() != 24) {
556 d << "-" << video_frame_rate();
560 d << "_" << container()->isdcf_name();
563 ContentList cl = content ();
565 /* XXX: this uses the first bit of content only */
567 /* The standard says we don't do this for trailers, for some strange reason */
568 if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) {
569 Ratio const * content_ratio = 0;
570 for (ContentList::iterator i = cl.begin(); i != cl.end(); ++i) {
571 shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
573 /* Here's the first piece of video content */
574 if (vc->scale().ratio ()) {
575 content_ratio = vc->scale().ratio ();
577 content_ratio = Ratio::from_ratio (vc->video_size().ratio ());
583 if (content_ratio && content_ratio != container()) {
584 d << "-" << content_ratio->isdcf_name();
588 if (!dm.audio_language.empty ()) {
589 d << "_" << dm.audio_language;
590 if (!dm.subtitle_language.empty()) {
591 d << "-" << dm.subtitle_language;
597 if (!dm.territory.empty ()) {
598 d << "_" << dm.territory;
599 if (!dm.rating.empty ()) {
600 d << "-" << dm.rating;
604 /* Find all mapped channels */
606 list<dcp::Channel> mapped;
607 for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) {
608 shared_ptr<const AudioContent> ac = dynamic_pointer_cast<const AudioContent> (*i);
610 list<dcp::Channel> c = ac->audio_mapping().mapped_dcp_channels ();
611 copy (c.begin(), c.end(), back_inserter (mapped));
622 for (list<dcp::Channel>::const_iterator i = mapped.begin(); i != mapped.end(); ++i) {
623 if (static_cast<int> (*i) >= audio_channels()) {
624 /* This channel is mapped but is not included in the DCP */
628 if ((*i) == dcp::LFE) {
636 d << "_" << non_lfe << lfe;
641 d << "_" << resolution_to_string (_resolution);
643 if (!dm.studio.empty ()) {
644 d << "_" << dm.studio;
647 if (if_created_now) {
648 d << "_" << boost::gregorian::to_iso_string (boost::gregorian::day_clock::local_day ());
650 d << "_" << boost::gregorian::to_iso_string (_isdcf_date);
653 if (!dm.facility.empty ()) {
654 d << "_" << dm.facility;
667 if (!dm.package_type.empty ()) {
668 d << "_" << dm.package_type;
674 /** @return name to give the DCP */
676 Film::dcp_name (bool if_created_now) const
678 if (use_isdcf_name()) {
679 return isdcf_name (if_created_now);
686 Film::set_directory (boost::filesystem::path d)
693 Film::set_name (string n)
696 signal_changed (NAME);
700 Film::set_use_isdcf_name (bool u)
703 signal_changed (USE_ISDCF_NAME);
707 Film::set_dcp_content_type (DCPContentType const * t)
709 _dcp_content_type = t;
710 signal_changed (DCP_CONTENT_TYPE);
714 Film::set_container (Ratio const * c)
717 signal_changed (CONTAINER);
721 Film::set_resolution (Resolution r)
724 signal_changed (RESOLUTION);
728 Film::set_j2k_bandwidth (int b)
731 signal_changed (J2K_BANDWIDTH);
735 Film::set_isdcf_metadata (ISDCFMetadata m)
738 signal_changed (ISDCF_METADATA);
742 Film::set_video_frame_rate (int f)
744 _video_frame_rate = f;
745 signal_changed (VIDEO_FRAME_RATE);
749 Film::set_audio_channels (int c)
752 signal_changed (AUDIO_CHANNELS);
756 Film::set_three_d (bool t)
759 signal_changed (THREE_D);
763 Film::set_interop (bool i)
766 signal_changed (INTEROP);
770 Film::set_burn_subtitles (bool b)
773 signal_changed (BURN_SUBTITLES);
777 Film::signal_changed (Property p)
783 set_video_frame_rate (_playlist->best_dcp_frame_rate ());
785 case Film::VIDEO_FRAME_RATE:
786 case Film::SEQUENCE_VIDEO:
787 _playlist->maybe_sequence_video ();
794 ui_signaller->emit (boost::bind (boost::ref (Changed), p));
799 Film::set_isdcf_date_today ()
801 _isdcf_date = boost::gregorian::day_clock::local_day ();
804 boost::filesystem::path
805 Film::j2c_path (int f, Eyes e, bool t) const
807 boost::filesystem::path p;
809 p /= video_identifier ();
813 s << setfill('0') << f;
815 if (e == EYES_LEFT) {
817 } else if (e == EYES_RIGHT) {
831 /** Find all the DCPs in our directory that can be dcp::DCP::read() and return details of their CPLs */
835 vector<CPLSummary> out;
837 boost::filesystem::path const dir = directory ();
838 for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator(dir); i != boost::filesystem::directory_iterator(); ++i) {
840 boost::filesystem::is_directory (*i) &&
841 i->path().leaf() != "j2c" && i->path().leaf() != "video" && i->path().leaf() != "info" && i->path().leaf() != "analysis"
849 i->path().leaf().string(),
850 dcp.cpls().front()->id(),
851 dcp.cpls().front()->annotation_text(),
852 dcp.cpls().front()->file()
865 Film::make_player () const
867 return shared_ptr<Player> (new Player (shared_from_this (), _playlist));
871 Film::set_signed (bool s)
874 signal_changed (SIGNED);
878 Film::set_encrypted (bool e)
881 signal_changed (ENCRYPTED);
885 Film::playlist () const
891 Film::content () const
893 return _playlist->content ();
897 Film::examine_content (shared_ptr<Content> c)
899 shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
900 JobManager::instance()->add (j);
904 Film::examine_and_add_content (shared_ptr<Content> c)
906 if (dynamic_pointer_cast<FFmpegContent> (c)) {
907 run_ffprobe (c->path(0), file ("ffprobe.log"), _log);
910 shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
912 _job_connections.push_back (
913 j->Finished.connect (bind (&Film::maybe_add_content, this, boost::weak_ptr<Job> (j), boost::weak_ptr<Content> (c)))
916 JobManager::instance()->add (j);
920 Film::maybe_add_content (weak_ptr<Job> j, weak_ptr<Content> c)
922 shared_ptr<Job> job = j.lock ();
923 if (!job || !job->finished_ok ()) {
927 shared_ptr<Content> content = c.lock ();
929 add_content (content);
934 Film::add_content (shared_ptr<Content> c)
936 /* Add video content after any existing content */
937 if (dynamic_pointer_cast<VideoContent> (c)) {
938 c->set_position (_playlist->video_end ());
945 Film::remove_content (shared_ptr<Content> c)
947 _playlist->remove (c);
951 Film::move_content_earlier (shared_ptr<Content> c)
953 _playlist->move_earlier (c);
957 Film::move_content_later (shared_ptr<Content> c)
959 _playlist->move_later (c);
963 Film::length () const
965 return _playlist->length ();
969 Film::best_video_frame_rate () const
971 return _playlist->best_dcp_frame_rate ();
975 Film::active_frame_rate_change (DCPTime t) const
977 return _playlist->active_frame_rate_change (t, video_frame_rate ());
981 Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
983 if (p == VideoContentProperty::VIDEO_FRAME_RATE) {
984 set_video_frame_rate (_playlist->best_dcp_frame_rate ());
986 p == AudioContentProperty::AUDIO_MAPPING ||
987 p == AudioContentProperty::AUDIO_CHANNELS) {
988 signal_changed (NAME);
992 ui_signaller->emit (boost::bind (boost::ref (ContentChanged), c, p));
997 Film::playlist_changed ()
999 signal_changed (CONTENT);
1000 signal_changed (NAME);
1004 Film::audio_frame_rate () const
1011 Film::set_sequence_video (bool s)
1013 _sequence_video = s;
1014 _playlist->set_sequence_video (s);
1015 signal_changed (SEQUENCE_VIDEO);
1018 /** @return Size of the largest possible image in whatever resolution we are using */
1020 Film::full_frame () const
1022 switch (_resolution) {
1024 return dcp::Size (2048, 1080);
1026 return dcp::Size (4096, 2160);
1029 DCPOMATIC_ASSERT (false);
1030 return dcp::Size ();
1033 /** @return Size of the frame */
1035 Film::frame_size () const
1037 return fit_ratio_within (container()->ratio(), full_frame (), 1);
1042 dcp::Certificate target,
1043 boost::filesystem::path cpl_file,
1044 dcp::LocalTime from,
1045 dcp::LocalTime until,
1046 dcp::Formulation formulation
1049 shared_ptr<const dcp::CPL> cpl (new dcp::CPL (cpl_file));
1050 shared_ptr<const dcp::Signer> signer = Config::instance()->signer();
1051 if (!signer->valid ()) {
1052 throw InvalidSignerError ();
1055 return dcp::DecryptedKDM (
1056 cpl, key(), from, until, "DCP-o-matic", cpl->content_title_text(), dcp::LocalTime().as_string()
1057 ).encrypt (signer, target, formulation);
1060 list<dcp::EncryptedKDM>
1062 list<shared_ptr<Screen> > screens,
1063 boost::filesystem::path dcp,
1064 dcp::LocalTime from,
1065 dcp::LocalTime until,
1066 dcp::Formulation formulation
1069 list<dcp::EncryptedKDM> kdms;
1071 for (list<shared_ptr<Screen> >::iterator i = screens.begin(); i != screens.end(); ++i) {
1072 if ((*i)->certificate) {
1073 kdms.push_back (make_kdm ((*i)->certificate.get(), dcp, from, until, formulation));
1080 /** @return The approximate disk space required to encode a DCP of this film with the
1081 * current settings, in bytes.
1084 Film::required_disk_space () const
1086 return uint64_t (j2k_bandwidth() / 8) * length().seconds();
1089 /** This method checks the disk that the Film is on and tries to decide whether or not
1090 * there will be enough space to make a DCP for it. If so, true is returned; if not,
1091 * false is returned and required and availabe are filled in with the amount of disk space
1092 * required and available respectively (in Gb).
1094 * Note: the decision made by this method isn't, of course, 100% reliable.
1097 Film::should_be_enough_disk_space (double& required, double& available) const
1099 boost::filesystem::space_info s = boost::filesystem::space (internal_video_mxf_dir ());
1100 required = double (required_disk_space ()) / 1073741824.0f;
1101 available = double (s.available) / 1073741824.0f;
1102 return (available - required) > 1;
1106 Film::subtitle_language () const
1108 set<string> languages;
1110 ContentList cl = content ();
1111 BOOST_FOREACH (shared_ptr<Content>& c, cl) {
1112 shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (c);
1114 languages.insert (sc->subtitle_language ());
1119 BOOST_FOREACH (string s, languages) {
1120 if (!all.empty ()) {