summaryrefslogtreecommitdiffstats
path: root/src/server/DuplexPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-12-13 20:53:58 -0500
committerDavid Robillard <d@drobilla.net>2016-12-14 14:47:13 -0500
commite7b2f7ee286350bc3bb56b44ed98e4d8bf49af82 (patch)
tree8e5a4e42b36bb5c321f24cdd492cd3dc0a941222 /src/server/DuplexPort.cpp
parent05c55a5be68318d2b7ca861a3012bf4893bcb82d (diff)
downloadingen-e7b2f7ee286350bc3bb56b44ed98e4d8bf49af82.tar.gz
ingen-e7b2f7ee286350bc3bb56b44ed98e4d8bf49af82.tar.bz2
ingen-e7b2f7ee286350bc3bb56b44ed98e4d8bf49af82.zip
Fix real-time issues with buffer allocation
Diffstat (limited to 'src/server/DuplexPort.cpp')
-rw-r--r--src/server/DuplexPort.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index 5eff4add..41312e65 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -62,7 +62,8 @@ DuplexPort::DuplexPort(BufferFactory& bufs,
}
}
- get_buffers(bufs, _voices, parent->polyphony(), false);
+ get_buffers(bufs, &BufferFactory::get_buffer,
+ _voices, parent->polyphony(), 0);
}
DuplexPort::~DuplexPort()
@@ -130,16 +131,26 @@ DuplexPort::on_property(const Raul::URI& uri, const Atom& value)
bool
DuplexPort::get_buffers(BufferFactory& bufs,
+ PortImpl::GetFn get,
Raul::Array<Voice>* voices,
uint32_t poly,
- bool real_time) const
+ size_t num_in_arcs) const
{
- if (!_is_driver_port) {
- if (_is_output) {
- return InputPort::get_buffers(bufs, voices, poly, real_time);
- } else {
- return PortImpl::get_buffers(bufs, voices, poly, real_time);
- }
+ if (!_is_driver_port && is_output()) {
+ return InputPort::get_buffers(bufs, get, voices, poly, num_in_arcs);
+ } else if (!_is_driver_port && is_input()) {
+ return PortImpl::get_buffers(bufs, get, voices, poly, num_in_arcs);
+ }
+ return false;
+}
+
+bool
+DuplexPort::setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly)
+{
+ if (!_is_driver_port && is_output()) {
+ return InputPort::setup_buffers(ctx, bufs, poly);
+ } else if (!_is_driver_port && is_input()) {
+ return PortImpl::setup_buffers(ctx, bufs, poly);
}
return false;
}