Scale default Atom Ringbuffer size with samplerate
authorRobin Gareus <robin@gareus.org>
Thu, 19 Jan 2017 20:07:22 +0000 (21:07 +0100)
committerRobin Gareus <robin@gareus.org>
Thu, 19 Jan 2017 20:35:22 +0000 (21:35 +0100)
This increases the safe-margin for plugins producing more messages
sent to the plugin GUI (usually fixed ~25Hz updates)

libs/ardour/lv2_plugin.cc

index 24fa22dcfd4bf747770679d51ffa24dc6653f0d7..a1a7ce860a4d56ceea7cb754c4b97d8c8d93662e 100644 (file)
@@ -1647,7 +1647,8 @@ LV2Plugin::write_from_ui(uint32_t       index,
                if (_atom_ev_buffers && _atom_ev_buffers[0]) {
                        bufsiz =  lv2_evbuf_get_capacity(_atom_ev_buffers[0]);
                }
-               rbs = max((size_t) bufsiz * 8, rbs);
+               int fact = ceilf(_session.frame_rate () / 3000.f);
+               rbs = max((size_t) bufsiz * std::max (8, fact), rbs);
                _from_ui = new RingBuffer<uint8_t>(rbs);
        }