X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fhints.cc;h=46704ebf817ae8d19118efc0baba1c90837c8421;hb=2de5d4f8a9ca8c2a684172d439dded71be71c047;hp=ddc412e55bb5bdda89f29154b6ccee021fc1b5ec;hpb=d09a831de180faba3d74a865f4373616ebd120c7;p=dcpomatic.git diff --git a/src/lib/hints.cc b/src/lib/hints.cc index ddc412e55..46704ebf8 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -19,22 +19,23 @@ */ +#include "audio_analysis.h" +#include "audio_content.h" +#include "audio_processor.h" +#include "compose.hpp" +#include "content.h" +#include "cross.h" #include "dcp_content_type.h" -#include "hints.h" -#include "types.h" #include "film.h" -#include "content.h" -#include "video_content.h" -#include "text_content.h" -#include "audio_processor.h" #include "font.h" #include "font_data.h" +#include "hints.h" +#include "player.h" #include "ratio.h" -#include "audio_analysis.h" -#include "compose.hpp" +#include "text_content.h" +#include "types.h" #include "util.h" -#include "cross.h" -#include "player.h" +#include "video_content.h" #include "writer.h" #include #include @@ -50,11 +51,8 @@ using std::cout; using std::make_shared; using std::max; -using std::min; -using std::pair; using std::shared_ptr; using std::string; -using std::vector; using std::weak_ptr; using boost::optional; using boost::bind; @@ -399,6 +397,7 @@ try check_ffec_and_ffmc_in_smpte_feature (); check_out_of_range_markers (); check_text_languages (); + check_audio_language (); if (check_loudness_done) { emit (bind(boost::ref(Progress), _("Examining subtitles and closed captions"))); @@ -406,7 +405,7 @@ try emit (bind(boost::ref(Progress), _("Examining audio, subtitles and closed captions"))); } - auto player = make_shared(film); + auto player = make_shared(film, Image::Alignment::COMPACT); player->set_ignore_video (); if (check_loudness_done) { /* We don't need to analyse audio because we already loaded a suitable analysis */ @@ -636,3 +635,20 @@ Hints::check_text_languages () } } } + + +void +Hints::check_audio_language () +{ + auto content = film()->content(); + auto mapped_audio = + std::find_if(content.begin(), content.end(), [](shared_ptr c) { + return c->audio && !c->audio->mapping().mapped_output_channels().empty(); + }); + + if (mapped_audio != content.end() && !film()->audio_language()) { + hint (_("Some of your content has audio but you have not set the audio language. It is advisable to set the audio language " + "in the \"DCP\" tab unless your audio has no spoken parts.")); + } +} +