diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-07-05 15:58:25 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-07-05 15:58:25 +0200 |
| commit | db3866008bf2ab1b921c44c4e3c70a909304ac84 (patch) | |
| tree | 947f73672f52ad659bd36c2cce8c04515a5f8d2c /src/lib/audio_analyser.cc | |
| parent | bb5acc8b8d783a4133b0b10285937d9151dc57c9 (diff) | |
Tidy a little and use some std::vector instead of raw arrays.
Diffstat (limited to 'src/lib/audio_analyser.cc')
| -rw-r--r-- | src/lib/audio_analyser.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/audio_analyser.cc b/src/lib/audio_analyser.cc index d5095c7e6..53d764a9b 100644 --- a/src/lib/audio_analyser.cc +++ b/src/lib/audio_analyser.cc @@ -60,8 +60,8 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG , _ebur128 (new AudioFilterGraph(film->audio_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<const Film> film, shared_ptr<const Play _ebur128->setup (_filters); #endif - _current = new AudioPoint[_film->audio_channels()]; + _current = std::vector<AudioPoint>(_film->audio_channels()); if (!from_zero) { _start = _playlist->start().get_value_or(DCPTime()); @@ -127,12 +127,9 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play AudioAnalyser::~AudioAnalyser () { - delete[] _current; for (auto i: _filters) { delete const_cast<Filter*> (i); } - delete[] _sample_peak; - delete[] _sample_peak_frame; } |
