From 31442cd63d6ff311b4fcf65e82d2797c0031ab53 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 16 Feb 2016 18:17:13 +0100 Subject: [PATCH] work-around case where metric is NULL in split cycles. This really needs to be fixed on a higher level. e.g Pluin::connect_and_run() needs to be passed the current time identical to PluginInsert::connect_and_run() --- libs/ardour/lv2_plugin.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 81266b8ed4..7791c0b7dd 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -2155,9 +2155,10 @@ LV2Plugin::connect_and_run(BufferSet& bufs, ? *metric_i : NULL; if (m != m_end && (!metric || metric->frame() > (*m).time())) { const Evoral::MIDIEvent ev(*m, false); - assert (ev.time() < nframes); - LV2_Evbuf_Iterator eend = lv2_evbuf_end(_ev_buffers[port_index]); - lv2_evbuf_write(&eend, ev.time(), 0, type, ev.size(), ev.buffer()); + if (ev.time() < nframes) { + LV2_Evbuf_Iterator eend = lv2_evbuf_end(_ev_buffers[port_index]); + lv2_evbuf_write(&eend, ev.time(), 0, type, ev.size(), ev.buffer()); + } ++m; } else { tmetric.set_metric(metric); -- 2.30.2