summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/server/Buffer.cpp16
-rw-r--r--src/server/InputPort.cpp13
-rw-r--r--src/server/PortImpl.cpp1
3 files changed, 19 insertions, 11 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 7af3d47e..fb7efa85 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -421,15 +421,21 @@ Buffer::update_value_buffer(SampleCount offset)
return;
}
- LV2_Atom_Sequence* seq = get<LV2_Atom_Sequence>();
+ LV2_Atom_Sequence* seq = get<LV2_Atom_Sequence>();
+ LV2_Atom_Event* latest = NULL;
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
- if (ev->time.frames <= offset && ev->body.type == _value_type) {
- memcpy(_value_buffer->get<LV2_Atom>(),
- &ev->body,
- lv2_atom_total_size(&ev->body));
+ if (ev->time.frames > offset) {
break;
+ } else if (ev->body.type == _value_type) {
+ latest = ev;
}
}
+
+ if (latest) {
+ memcpy(_value_buffer->get<LV2_Atom>(),
+ &latest->body,
+ lv2_atom_total_size(&latest->body));
+ }
}
#ifndef NDEBUG
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 6e72f6f6..fe613f31 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -217,12 +217,15 @@ SampleCount
InputPort::next_value_offset(SampleCount offset, SampleCount end) const
{
SampleCount earliest = end;
+
+ if (_user_buffer) {
+ earliest = _user_buffer->next_value_offset(offset, end);
+ }
+
for (const auto& arc : _arcs) {
- if (arc.tail()->type() != this->type()) {
- const SampleCount o = arc.tail()->next_value_offset(offset, end);
- if (o < earliest) {
- earliest = o;
- }
+ const SampleCount o = arc.tail()->next_value_offset(offset, end);
+ if (o < earliest) {
+ earliest = o;
}
}
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index ec54e9bd..066ac005 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -555,7 +555,6 @@ PortImpl::post_process(RunContext& context)
{
for (uint32_t v = 0; v < _poly; ++v) {
update_set_state(context, v);
- update_values(0, v);
}
monitor(context);