work-around case where metric is NULL in split cycles.
authorRobin Gareus <robin@gareus.org>
Tue, 16 Feb 2016 17:17:13 +0000 (18:17 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 16 Feb 2016 17:17:13 +0000 (18:17 +0100)
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

index 81266b8ed4aed5c64b8c676dee5b1a00803aad17..7791c0b7dd7ec75cea17f4cd14052a3813c22d8e 100644 (file)
@@ -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<framepos_t> 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);