summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/AudioBuffer.cpp9
-rw-r--r--src/server/Buffer.cpp2
-rw-r--r--src/server/JackDriver.cpp4
3 files changed, 10 insertions, 5 deletions
diff --git a/src/server/AudioBuffer.cpp b/src/server/AudioBuffer.cpp
index 16a79bc0..a3c87fea 100644
--- a/src/server/AudioBuffer.cpp
+++ b/src/server/AudioBuffer.cpp
@@ -45,9 +45,12 @@ AudioBuffer::AudioBuffer(BufferFactory& bufs, LV2_URID type, uint32_t size)
if (type == bufs.uris().atom_Sound) {
// Audio port (Vector of float)
- LV2_Atom_Vector* body = (LV2_Atom_Vector*)atom();
- body->body.child_size = sizeof(float);
- body->body.child_type = bufs.uris().atom_Float;
+ LV2_Atom_Vector* vec = (LV2_Atom_Vector*)_atom;
+ vec->body.child_size = sizeof(float);
+ vec->body.child_type = bufs.uris().atom_Float;
+ _atom->size = size - sizeof(LV2_Atom_Vector);
+ } else {
+ _atom->size = size - sizeof(LV2_Atom);
}
_atom->type = type;
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 4bc39c12..30a0781c 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -89,7 +89,7 @@ void
Buffer::copy(Context& context, const Buffer* src)
{
// Copy only if src is a POD object that fits
- if (src->_atom->type != 0 && sizeof(LV2_Atom) + src->_atom->size <= capacity()) {
+ if (src->_atom->type != 0 && sizeof(LV2_Atom) + src->_atom->size <= capacity()) {
memcpy(_atom, src->_atom, sizeof(LV2_Atom) + src->_atom->size);
}
assert(_atom->type != 1);
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 30673316..45b168f9 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -113,6 +113,7 @@ JackPort::pre_process(ProcessContext& context)
_buffer = jack_port_get_buffer(_jack_port, nframes);
if (!is_input()) {
+ ((AudioBuffer*)_patch_port->buffer(0).get())->clear();
return;
}
@@ -149,10 +150,11 @@ JackPort::post_process(ProcessContext& context)
}
if (!_buffer) {
- // First cycle for a new outputs, so pre_process wasn't called
+ // First cycle for a new output, so pre_process wasn't called
_buffer = jack_port_get_buffer(_jack_port, nframes);
}
+ _patch_port->post_process(context);
if (_patch_port->is_a(PortType::AUDIO)) {
AudioBuffer* patch_buf = (AudioBuffer*)_patch_port->buffer(0).get();