summaryrefslogtreecommitdiff
path: root/libs/ardour/thread_buffers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/thread_buffers.cc')
-rw-r--r--libs/ardour/thread_buffers.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/ardour/thread_buffers.cc b/libs/ardour/thread_buffers.cc
index 2436b6d365..f30edee572 100644
--- a/libs/ardour/thread_buffers.cc
+++ b/libs/ardour/thread_buffers.cc
@@ -18,6 +18,7 @@
*/
#include <iostream>
+#include <algorithm>
#include "ardour/audioengine.h"
#include "ardour/buffer_set.h"
@@ -68,6 +69,10 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
void
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;
}