Enforce minimum reel length when using REELTYPE_BY_LENGTH.
[dcpomatic.git] / src / lib / audio_filter.cc
index 44345fc9d11f4e817865a402266d2b2bedff1b41..3d3ecdfbb3deed7bfef315818646ffaf12e0dac3 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "audio_filter.h"
 #include "audio_buffers.h"
+#include "util.h"
 #include <cmath>
 
 using std::min;
@@ -105,7 +106,7 @@ AudioFilter::run (shared_ptr<const AudioBuffers> in)
 
        int const amount = min (in->frames(), _tail->frames());
        if (amount < _tail->frames ()) {
-               _tail->move (amount, 0, _tail->frames() - amount);
+               _tail->move (_tail->frames() - amount, amount, 0);
        }
        _tail->copy_from (in.get(), amount, in->frames() - amount, _tail->frames () - amount);