diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-21 02:02:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-21 02:02:42 +0100 |
| commit | 7fff85ef947f9353317c0125dc37f1f16faecbf1 (patch) | |
| tree | cb843452d7f1f442530f72ae92967bf1f25d3ccc /src | |
| parent | 08ea137fc8a74f622821dc4e6953f635837118c8 (diff) | |
Prevent DCP creation if we're trying not to burn in text subs (#606).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dcp_content.h | 7 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_content.h | 7 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 8 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 3 | ||||
| -rw-r--r-- | src/lib/film.cc | 18 | ||||
| -rw-r--r-- | src/lib/subrip_content.h | 7 | ||||
| -rw-r--r-- | src/lib/subtitle_content.cc | 5 | ||||
| -rw-r--r-- | src/lib/subtitle_content.h | 4 |
8 files changed, 50 insertions, 9 deletions
diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index 54527422e..2d0aaacde 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -59,11 +59,16 @@ public: std::string identifier () const; /* SubtitleContent */ - bool has_subtitles () const { + + bool has_text_subtitles () const { boost::mutex::scoped_lock lm (_mutex); return _has_subtitles; } + bool has_image_subtitles () const { + return false; + } + boost::filesystem::path directory () const; bool encrypted () const { diff --git a/src/lib/dcp_subtitle_content.h b/src/lib/dcp_subtitle_content.h index 05af71690..9fea81c2a 100644 --- a/src/lib/dcp_subtitle_content.h +++ b/src/lib/dcp_subtitle_content.h @@ -34,10 +34,15 @@ public: DCPTime full_length () const; /* SubtitleContent */ - bool has_subtitles () const { + + bool has_text_subtitles () const { return true; } + bool has_image_subtitles () const { + return false; + } + private: DCPTime _length; }; diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index c4fc36357..8feb7df57 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -298,7 +298,13 @@ FFmpegContent::subtitles_during (ContentTimePeriod period, bool starting) const } bool -FFmpegContent::has_subtitles () const +FFmpegContent::has_text_subtitles () const +{ + return false; +} + +bool +FFmpegContent::has_image_subtitles () const { return !subtitle_streams().empty (); } diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 5c2b5496d..c5797d5d1 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -70,7 +70,8 @@ public: std::vector<AudioStreamPtr> audio_streams () const; /* SubtitleContent */ - bool has_subtitles () const; + bool has_text_subtitles () const; + bool has_image_subtitles () const; void set_filters (std::vector<Filter const *> const &); diff --git a/src/lib/film.cc b/src/lib/film.cc index 66f1de868..75dfa45eb 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -277,15 +277,27 @@ Film::audio_analysis_path () const void Film::make_dcp () { - set_isdcf_date_today (); - if (dcp_name().find ("/") != string::npos) { throw BadSettingError (_("name"), _("cannot contain slashes")); } + bool must_burn = false; + ContentList cl = content (); + BOOST_FOREACH (shared_ptr<Content> c, cl) { + shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (c); + if (sc && sc->has_image_subtitles() && sc->use_subtitles() && !burn_subtitles()) { + must_burn = true; + } + } + + if (must_burn) { + throw EncodeError (_("this project has content with image-based subtitles, which this version of DCP-o-matic cannot include as separate DCP subtitles. To use subtitles with this project you must burn them into the image (tick the box on the DCP Video tab).")); + } + + set_isdcf_date_today (); + environment_info (log ()); - ContentList cl = content (); for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) { LOG_GENERAL ("Content: %1", (*i)->technical_summary()); } diff --git a/src/lib/subrip_content.h b/src/lib/subrip_content.h index 09346a174..342efd4de 100644 --- a/src/lib/subrip_content.h +++ b/src/lib/subrip_content.h @@ -37,10 +37,15 @@ public: DCPTime full_length () const; /* SubtitleContent */ - bool has_subtitles () const { + + bool has_text_subtitles () const { return true; } + bool has_image_subtitles () const { + return false; + } + static std::string const font_id; private: diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 215829659..c8fa75e7c 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -283,3 +283,8 @@ SubtitleContent::font_changed () signal_changed (SubtitleContentProperty::FONTS); } +bool +SubtitleContent::has_subtitles () const +{ + return has_text_subtitles() || has_image_subtitles(); +} diff --git a/src/lib/subtitle_content.h b/src/lib/subtitle_content.h index c00ec6f90..7f2e3b136 100644 --- a/src/lib/subtitle_content.h +++ b/src/lib/subtitle_content.h @@ -53,7 +53,9 @@ public: void as_xml (xmlpp::Node *) const; std::string identifier () const; - virtual bool has_subtitles () const = 0; + bool has_subtitles () const; + virtual bool has_text_subtitles () const = 0; + virtual bool has_image_subtitles () const = 0; void add_font (boost::shared_ptr<Font> font); |
