X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;fp=src%2Flib%2Ffilm.cc;h=a24e9aa30046b316408a810e9b5a2d31d3c3164c;hb=cef7a679a59044a5c807768042deecfd56ec6fc2;hp=a89d58a1f7e760da27f4c2913a30cefab3bb15c3;hpb=87d5a977da0696fbe73b96b2679b7cbb471e7255;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index a89d58a1f..a24e9aa30 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -54,6 +54,8 @@ #include "cinema.h" #include "change_signaller.h" #include "check_content_change_job.h" +#include "ffmpeg_subtitle_stream.h" +#include "font.h" #include #include #include @@ -302,6 +304,39 @@ Film::audio_analysis_path (shared_ptr playlist) const return p; } + +boost::filesystem::path +Film::subtitle_analysis_path (shared_ptr content) const +{ + boost::filesystem::path p = dir ("analysis"); + + Digester digester; + digester.add (content->digest()); + + if (!content->text.empty()) { + shared_ptr tc = content->text.front(); + digester.add (tc->x_scale()); + digester.add (tc->y_scale()); + BOOST_FOREACH (shared_ptr i, tc->fonts()) { + digester.add (i->id()); + } + if (tc->effect()) { + digester.add (tc->effect().get()); + } + digester.add (tc->line_spacing()); + digester.add (tc->outline_width()); + } + + shared_ptr fc = dynamic_pointer_cast(content); + if (fc) { + digester.add (fc->subtitle_stream()->identifier()); + } + + p /= digester.get (); + return p; +} + + /** Add suitable Jobs to the JobManager to create a DCP for this Film. * @param gui true if this is being called from a GUI tool. * @param check true to check the content in the project for changes before making the DCP.