Make separate reels for parts of the timeline with no video when
[dcpomatic.git] / src / lib / audio_delay.cc
index e33d9879b1f2fe20064e93cbcbff8688c277e69d..391a201a25253e980931431798aa948cf09ba9b6 100644 (file)
 #include "audio_delay.h"
 #include "audio_buffers.h"
 #include "dcpomatic_assert.h"
-#include <boost/make_shared.hpp>
 #include <iostream>
 
 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<const AudioBuffers> in)
        /* You can't call this with varying channel counts */
        DCPOMATIC_ASSERT (!_tail || in->channels() == _tail->channels());
 
-       shared_ptr<AudioBuffers> out = make_shared<AudioBuffers> (in->channels(), in->frames());
+       shared_ptr<AudioBuffers> out (new AudioBuffers (in->channels(), in->frames()));
 
        if (in->frames() > _samples) {
 
@@ -73,7 +71,7 @@ AudioDelay::run (shared_ptr<const AudioBuffers> 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());