summaryrefslogtreecommitdiff
path: root/src/lib/analyse_audio_job.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-02-11 13:10:48 +0100
committerCarl Hetherington <cth@carlh.net>2024-02-11 22:55:27 +0100
commit527093fa643049d370f4daee8206349981edbf95 (patch)
treef2d8e39174c64a059545c109beadce44369d857b /src/lib/analyse_audio_job.cc
parent4d49c6e02b5226147058ca8015acf0ad1f440e9b (diff)
Fix apparently ineffective processors when analysing audio (#2671).
A whole film ("DCP side") analysis would behave the same as a single piece of content analysis if the film only had one piece of content. Here we also clarify that audio analysis of the whole film is different to that for a single piece of content; for the whole film we use processors, and for single pieces of content we do not.
Diffstat (limited to 'src/lib/analyse_audio_job.cc')
-rw-r--r--src/lib/analyse_audio_job.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc
index ca0f49f57..a6ce5dcc8 100644
--- a/src/lib/analyse_audio_job.cc
+++ b/src/lib/analyse_audio_job.cc
@@ -47,12 +47,16 @@ using namespace boost::placeholders;
#endif
-/** @param from_zero true to analyse audio from time 0 in the playlist, otherwise begin at Playlist::start */
-AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool from_zero)
+/** @param whole_film true to analyse the whole film' audio (i.e. start from time 0 and use processors), false
+ * to analyse just the single piece of content in the playlist (i.e. start from Playlist::start() and do not
+ * use processors.
+ */
+AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool whole_film)
: Job (film)
- , _analyser (film, playlist, from_zero, boost::bind(&Job::set_progress, this, _1, false))
+ , _analyser(film, playlist, whole_film, boost::bind(&Job::set_progress, this, _1, false))
, _playlist (playlist)
, _path (film->audio_analysis_path(playlist))
+ , _whole_film(whole_film)
{
LOG_DEBUG_AUDIO_ANALYSIS_NC("AnalyseAudioJob::AnalyseAudioJob");
}
@@ -89,6 +93,9 @@ AnalyseAudioJob::run ()
player->set_fast ();
player->set_play_referenced ();
player->Audio.connect (bind(&AudioAnalyser::analyse, &_analyser, _1, _2));
+ if (!_whole_film) {
+ player->set_disable_audio_processor();
+ }
bool has_any_audio = false;
for (auto c: _playlist->content()) {