summaryrefslogtreecommitdiff
path: root/src/lib/audio_analyser.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/audio_analyser.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/audio_analyser.cc')
-rw-r--r--src/lib/audio_analyser.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/audio_analyser.cc b/src/lib/audio_analyser.cc
index df76932de..6e7b9fa86 100644
--- a/src/lib/audio_analyser.cc
+++ b/src/lib/audio_analyser.cc
@@ -52,7 +52,7 @@ using namespace dcpomatic;
static auto constexpr num_points = 1024;
-AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool from_zero, std::function<void (float)> set_progress)
+AudioAnalyser::AudioAnalyser(shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool whole_film, std::function<void (float)> set_progress)
: _film (film)
, _playlist (playlist)
, _set_progress (set_progress)
@@ -71,7 +71,7 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
_current = std::vector<AudioPoint>(_film->audio_channels());
- if (!from_zero) {
+ if (!whole_film) {
_start = _playlist->start().get_value_or(DCPTime());
}
@@ -87,7 +87,9 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
};
auto content = _playlist->content();
- if (content.size() == 1 && content[0]->audio) {
+ if (whole_film) {
+ _leqm_channels = film->audio_channels();
+ } else {
_leqm_channels = 0;
for (auto channel: content[0]->audio->mapping().mapped_output_channels()) {
/* This means that if, for example, a file only maps C we will
@@ -96,8 +98,6 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
*/
_leqm_channels = std::min(film->audio_channels(), channel + 1);
}
- } else {
- _leqm_channels = film->audio_channels();
}
/* XXX: is this right? Especially for more than 5.1? */