X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_delay.cc;h=391a201a25253e980931431798aa948cf09ba9b6;hb=715d87a4cf9e4697a2f67881776c19c4ce8af581;hp=e33d9879b1f2fe20064e93cbcbff8688c277e69d;hpb=5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f;p=dcpomatic.git diff --git a/src/lib/audio_delay.cc b/src/lib/audio_delay.cc index e33d9879b..391a201a2 100644 --- a/src/lib/audio_delay.cc +++ b/src/lib/audio_delay.cc @@ -21,12 +21,10 @@ #include "audio_delay.h" #include "audio_buffers.h" #include "dcpomatic_assert.h" -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; AudioDelay::AudioDelay (int samples) : _samples (samples) @@ -40,7 +38,7 @@ AudioDelay::run (shared_ptr in) /* You can't call this with varying channel counts */ DCPOMATIC_ASSERT (!_tail || in->channels() == _tail->channels()); - shared_ptr out = make_shared (in->channels(), in->frames()); + shared_ptr out (new AudioBuffers (in->channels(), in->frames())); if (in->frames() > _samples) { @@ -73,7 +71,7 @@ AudioDelay::run (shared_ptr in) } /* Shuffle the tail down */ - _tail->move (out->frames(), 0, _tail->frames() - out->frames()); + _tail->move (_tail->frames() - out->frames(), out->frames(), 0); /* Copy input into the tail */ _tail->copy_from (in.get(), in->frames(), 0, _tail->frames() - in->frames());