X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_analyser.cc;h=53d764a9b58dfbe55083719760e17f4a5db96334;hb=ac34066d5e448d1984d11a180be74e31b6e13b5c;hp=64d200c76c19f134e2a5e2f02169b7f283c1500a;hpb=4ce4b8d3429a97eb4df63460c7e73863f44a621e;p=dcpomatic.git diff --git a/src/lib/audio_analyser.cc b/src/lib/audio_analyser.cc index 64d200c76..53d764a9b 100644 --- a/src/lib/audio_analyser.cc +++ b/src/lib/audio_analyser.cc @@ -60,8 +60,8 @@ AudioAnalyser::AudioAnalyser (shared_ptr film, shared_ptraudio_frame_rate(), film->audio_channels())) #endif - , _sample_peak (new float[film->audio_channels()]) - , _sample_peak_frame (new Frame[film->audio_channels()]) + , _sample_peak (film->audio_channels()) + , _sample_peak_frame (film->audio_channels()) , _analysis (film->audio_channels()) { @@ -70,7 +70,7 @@ AudioAnalyser::AudioAnalyser (shared_ptr film, shared_ptrsetup (_filters); #endif - _current = new AudioPoint[_film->audio_channels()]; + _current = std::vector(_film->audio_channels()); if (!from_zero) { _start = _playlist->start().get_value_or(DCPTime()); @@ -89,8 +89,8 @@ 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(); + if (content.size() == 1 && content[0]->audio) { + leqm_channels = content[0]->audio->mapping().mapped_output_channels().size(); } /* XXX: is this right? Especially for more than 5.1? */ @@ -127,12 +127,9 @@ AudioAnalyser::AudioAnalyser (shared_ptr film, shared_ptr (i); } - delete[] _sample_peak; - delete[] _sample_peak_frame; }