summaryrefslogtreecommitdiff
path: root/libs/ardour/thread_buffers.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-11-29 22:26:33 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2013-11-29 22:26:33 -0500
commitd1cc7e5a50e2144d7aea01bc5eceed6657513c1b (patch)
treeae923ee081a7b19a1f3cc29da50dd12de5bd5596 /libs/ardour/thread_buffers.cc
parent0c4457fa8361d7678b09ec5911917750e7ade67e (diff)
fix up a bunch of confusion regarding the size/capacity/allocation of audio & midi buffers
Diffstat (limited to 'libs/ardour/thread_buffers.cc')
-rw-r--r--libs/ardour/thread_buffers.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/ardour/thread_buffers.cc b/libs/ardour/thread_buffers.cc
index fd3160bb15..e469187ce9 100644
--- a/libs/ardour/thread_buffers.cc
+++ b/libs/ardour/thread_buffers.cc
@@ -60,7 +60,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
size_t count = std::max (scratch_buffers->available().get(*t), howmany.get(*t));
- size_t size = _engine->raw_buffer_size (*t);
+ size_t size = _engine->raw_buffer_size (*t) / sizeof (Sample);
scratch_buffers->ensure_buffers (*t, count, size);
mix_buffers->ensure_buffers (*t, count, size);
@@ -68,12 +68,14 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
route_buffers->ensure_buffers (*t, count, size);
}
+ size_t audio_buffer_size = _engine->raw_buffer_size (DataType::AUDIO) / sizeof (Sample);
+
delete [] gain_automation_buffer;
- gain_automation_buffer = new gain_t[_engine->raw_buffer_size (DataType::AUDIO)];
+ gain_automation_buffer = new gain_t[audio_buffer_size];
delete [] send_gain_automation_buffer;
- send_gain_automation_buffer = new gain_t[_engine->raw_buffer_size (DataType::AUDIO)];
+ send_gain_automation_buffer = new gain_t[audio_buffer_size];
- allocate_pan_automation_buffers (_engine->raw_buffer_size (DataType::AUDIO), howmany.n_audio(), false);
+ allocate_pan_automation_buffers (audio_buffer_size, howmany.n_audio(), false);
}
void