Tidy up PluginInsert's handling of how it chooses to map plugin IO to that of the...
[ardour.git] / libs / ardour / thread_buffers.cc
index e319acc32930403851b586aedc4494ebd3439998..f30edee572ad0f63bc6e16ee0483d059bfef1c0a 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <iostream>
+#include <algorithm>
 
 #include "ardour/audioengine.h"
 #include "ardour/buffer_set.h"
@@ -66,8 +67,12 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
 }
 
 void
-ThreadBuffers::allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force)
+ThreadBuffers::allocate_pan_automation_buffers (framecnt_t nframes, uint32_t howmany, bool force)
 {
+        /* we always need at least 2 pan buffers */
+
+        howmany = max (2U, howmany);
+
        if (!force && howmany <= npan_buffers) {
                return;
        }