diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-14 13:10:59 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-14 13:10:59 -0400 |
commit | 6bcdf4f0f106d0b83ed7f221f546c132585e19e7 (patch) | |
tree | 1ebbd4c6a63943952cd9b4ec6a7adcc8ad506883 /libs/ardour/lv2_plugin.cc | |
parent | e711dfae12a3922476f5ff39c6b015d6617ed16c (diff) | |
parent | 7a431f892ec6e7e2283885c474b680081c983762 (diff) |
fix merge issues with master
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 95a29b7c8f..220ef9ca80 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -1137,8 +1137,20 @@ LV2Plugin::write_from_ui(uint32_t index, const uint8_t* body) { if (!_from_ui) { - _from_ui = new RingBuffer<uint8_t>( - _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS); + size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS; + /* buffer data communication from plugin UI to plugin instance. + * this buffer needs to potentially hold + * (port's minimumSize) * (audio-periods) / (UI-periods) + * bytes. + * + * e.g 48kSPS / 128fpp -> audio-periods = 375 Hz + * ui-periods = 25 Hz (SuperRapidScreenUpdate) + * default minimumSize = 32K (see LV2Plugin::allocate_atom_event_buffers() + * -> 15 * 32K + * it is safe to overflow (but the plugin state may be inconsistent). + */ + rbs = max((size_t) 32768 * 6, rbs); + _from_ui = new RingBuffer<uint8_t>(rbs); } if (!write_to(_from_ui, index, protocol, size, body)) { @@ -1165,8 +1177,10 @@ void LV2Plugin::enable_ui_emmission() { if (!_to_ui) { - _to_ui = new RingBuffer<uint8_t>( - _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS); + /* see note in LV2Plugin::write_from_ui() */ + size_t rbs = _session.engine().raw_buffer_size(DataType::MIDI) * NBUFS; + rbs = max((size_t) 32768 * 8, rbs); + _to_ui = new RingBuffer<uint8_t>(rbs); } } |