summaryrefslogtreecommitdiffstats
path: root/src/server/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-22 15:33:57 +0000
committerDavid Robillard <d@drobilla.net>2012-05-22 15:33:57 +0000
commit81884522025e2147e309b8042bbbc6ebcd927cc7 (patch)
tree39bc63bd84c647a8d889d939bde659639bb4f95e /src/server/InputPort.cpp
parentb1d4027b58465d9cc31d6cb1be05a7ff4f202711 (diff)
downloadingen-81884522025e2147e309b8042bbbc6ebcd927cc7.tar.gz
ingen-81884522025e2147e309b8042bbbc6ebcd927cc7.tar.bz2
ingen-81884522025e2147e309b8042bbbc6ebcd927cc7.zip
Fix crash when setting nodes polyphonic.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4433 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/InputPort.cpp')
-rw-r--r--src/server/InputPort.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index ebe5d41d..3ff8cd41 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -88,8 +88,9 @@ InputPort::get_buffers(Context& context,
if (is_a(PortType::AUDIO) && num_edges == 0) {
// Audio input with no edges, use shared zero buffer
- for (uint32_t v = 0; v < poly; ++v)
+ for (uint32_t v = 0; v < poly; ++v) {
buffers->at(v) = bufs.silent_buffer();
+ }
return false;
} else if (num_edges == 1) {
@@ -97,8 +98,9 @@ InputPort::get_buffers(Context& context,
if (!_edges.front().must_mix() &&
!_edges.front().must_queue()) {
// Single non-mixing connection, use buffers directly
- for (uint32_t v = 0; v < poly; ++v)
+ for (uint32_t v = 0; v < poly; ++v) {
buffers->at(v) = _edges.front().buffer(v);
+ }
return false;
}
}
@@ -106,7 +108,8 @@ InputPort::get_buffers(Context& context,
// Otherwise, allocate local buffers
for (uint32_t v = 0; v < poly; ++v) {
- buffers->at(v) = _bufs.get(context, buffer_type(), _buffer_size);
+ buffers->at(v).reset();
+ buffers->at(v) = bufs.get(context, buffer_type(), _buffer_size);
buffers->at(v)->clear();
}
return true;