lv2: increase scratch buffer size to request port minimum size
authorRobin Gareus <robin@gareus.org>
Sat, 16 Nov 2013 23:33:32 +0000 (00:33 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 16 Nov 2013 23:33:32 +0000 (00:33 +0100)
libs/ardour/lv2_plugin.cc

index f5dcc264101b33e456a093ca1e670a4162b2ebc6..da514f92e4e60a6b3028f0bbd30ed540c844bcd1 100644 (file)
@@ -1508,7 +1508,7 @@ LV2Plugin::allocate_atom_event_buffers()
                return;
        }
 
-       DEBUG_TRACE(DEBUG::LV2, string_compose("allocate %1 atom_ev_buffers\n", total_atom_buffers));
+       DEBUG_TRACE(DEBUG::LV2, string_compose("allocate %1 atom_ev_buffers of %d bytes\n", total_atom_buffers, minimumSize));
        _atom_ev_buffers = (LV2_Evbuf**) malloc((total_atom_buffers + 1) * sizeof(LV2_Evbuf*));
        for (int i = 0; i < total_atom_buffers; ++i ) {
                _atom_ev_buffers[i] = lv2_evbuf_new(minimumSize, LV2_EVBUF_ATOM,
@@ -1681,6 +1681,9 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
                                }
                        } else if (!valid) {
                                // Nothing we understand or care about, connect to scratch
+                               // see note for midi-buffer size above
+                               scratch_bufs.ensure_lv2_bufsize((flags & PORT_INPUT),
+                                               0, _port_minimumSize[port_index]);
                                _ev_buffers[port_index] = scratch_bufs.get_lv2_midi(
                                        (flags & PORT_INPUT), 0, (flags & PORT_EVENT));
                        }