#include "filter.h"
#include "playlist.h"
#include "types.h"
-#include "warnings.h"
+#include <dcp/warnings.h>
extern "C" {
#include <leqm_nrt.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
#include <libavutil/channel_layout.h>
#ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
#include <libavfilter/f_ebur128.h>
#endif
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
}
#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())
{
_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());
AudioAnalyser::~AudioAnalyser ()
{
- delete[] _current;
for (auto i: _filters) {
delete const_cast<Filter*> (i);
}
- delete[] _sample_peak;
- delete[] _sample_peak_frame;
}
void
-AudioAnalyser::analyse (shared_ptr<const AudioBuffers> b, DCPTime time)
+AudioAnalyser::analyse (shared_ptr<AudioBuffers> b, DCPTime time)
{
LOG_DEBUG_AUDIO_ANALYSIS("Received %1 frames at %2", b->frames(), to_string(time));
DCPOMATIC_ASSERT (time >= _start);
vector<double> interleaved(frames * channels);
for (int j = 0; j < channels; ++j) {
- float* data = b->data(j);
+ float const* data = b->data(j);
for (int i = 0; i < frames; ++i) {
float s = data[i];