From: Carl Hetherington Date: Thu, 20 May 2021 18:15:14 +0000 (+0200) Subject: Specify correct number of channels for LEQ(m) analyses of single pieces of content... X-Git-Tag: v2.15.150~6 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=4ce4b8d3429a97eb4df63460c7e73863f44a621e;hp=48f5b7ecaca25b99afdb78ca0ccd28c27db8243f Specify correct number of channels for LEQ(m) analyses of single pieces of content (#1991) If we're analysing one piece of content, pass its channel count into the leqm::Calculator rather than just using the film channel count. --- diff --git a/src/lib/audio_analyser.cc b/src/lib/audio_analyser.cc index 3868e05b7..64d200c76 100644 --- a/src/lib/audio_analyser.cc +++ b/src/lib/audio_analyser.cc @@ -87,8 +87,14 @@ AudioAnalyser::AudioAnalyser (shared_ptr film, shared_ptraudio_channels(); + auto content = _playlist->content(); + if (content.size() == 1 && content[0]->audio && content[0]->audio->stream()) { + leqm_channels = content[0]->audio->stream()->channels(); + } + /* XXX: is this right? Especially for more than 5.1? */ - vector channel_corrections(film->audio_channels(), 1); + vector channel_corrections(leqm_channels, 1); add_if_required (channel_corrections, 4, -3); // Ls add_if_required (channel_corrections, 5, -3); // Rs add_if_required (channel_corrections, 6, -144); // HI @@ -103,7 +109,7 @@ AudioAnalyser::AudioAnalyser (shared_ptr film, shared_ptraudio_channels(), + leqm_channels, film->audio_frame_rate(), 24, channel_corrections,