aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-07-29 00:40:44 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-07-29 00:40:44 +0200
commit5fbcf021517ecdaa4f9b4035eb006beb51820ee8 (patch)
treeef13dfba55bcbe184131e33e18121d0c95cdfccd
parentd25750f8fb6513255adeb91fc5b4b31b9c0cc398 (diff)
downloadsynthpod-5fbcf021517ecdaa4f9b4035eb006beb51820ee8.tar.xz
nk: fix rb buffersz estimate of event-less plugs.
-rw-r--r--VERSION2
-rw-r--r--plugins/synthpod_common_nk.c12
-rw-r--r--sandbox_ui.lv2/sandbox_io.h6
3 files changed, 11 insertions, 9 deletions
diff --git a/VERSION b/VERSION
index 1896d763..99d5323f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.6043
+0.1.6045
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index 69a34aaf..2ef58184 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -3504,7 +3504,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
mod->subj = handle->map->map(handle->map->handle, mod_uri);
const unsigned num_ports = lilv_plugin_get_num_ports(plug) + 2; // + automation ports
- mod->minimum = 0;
+ mod->minimum = sizeof(LV2_Atom_Object);
for(unsigned p=0; p<num_ports - 2; p++) // - automation ports
{
@@ -3562,7 +3562,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
audio->gain = 0.f;
//TODO
- mod->minimum += sizeof(LV2UI_Peak_Data);
+ mod->minimum += 3*(sizeof(LV2_Atom_Property) + sizeof(LV2_Atom_Float));
}
else if(is_cv)
{
@@ -3573,7 +3573,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
audio->gain = 0.f;
//TODO
- mod->minimum += sizeof(LV2UI_Peak_Data);
+ mod->minimum += 3*(sizeof(LV2_Atom_Property) + sizeof(LV2_Atom_Float));
}
else if(is_control)
{
@@ -3699,7 +3699,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
lilv_scale_points_free(port_points);
}
- mod->minimum += sizeof(float);
+ mod->minimum += sizeof(LV2_Atom_Property) + sizeof(LV2_Atom_Float);
}
else if(is_atom)
{
@@ -3720,7 +3720,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
LilvNode *min_size= lilv_port_get(plug, port->port, handle->regs.port.minimum_size.node);
if(min_size)
{
- mod->minimum += lilv_node_as_int(min_size);
+ mod->minimum += sizeof(LV2_Atom_Property) + sizeof(LV2_Atom) + lilv_node_as_int(min_size);
lilv_node_free(min_size);
}
else
@@ -3744,7 +3744,7 @@ _mod_init(plughandle_t *handle, mod_t *mod, const LilvPlugin *plug)
mod->sink_type |= port->type;
}
- mod->minimum *= 4; // to be on the safe side
+ mod->minimum *= 8; // to be on the safe side
// automation input port
{
diff --git a/sandbox_ui.lv2/sandbox_io.h b/sandbox_ui.lv2/sandbox_io.h
index 7b89c1fc..ebd8bb8b 100644
--- a/sandbox_ui.lv2/sandbox_io.h
+++ b/sandbox_ui.lv2/sandbox_io.h
@@ -251,8 +251,10 @@ _sandbox_io_send(sandbox_io_t *io, uint32_t index,
? io->from_master
: io->to_master;
- // reserve 8192 additional bytes for the parent atom and dictionary
- const size_t req_sz = size + 8192; //FIXME is this enough?
+ // reserve additional bytes for the parent atom and dictionary
+ const size_t add_sz = sizeof(LV2_Atom_Object) + 3*(sizeof(LV2_Atom_Property) + sizeof(LV2_Atom_Int));
+ const size_t dict_sz = 1024; //FIXME how big ?
+ const size_t req_sz = size + add_sz + dict_sz;
size_t max_sz;
uint8_t *buf_tx;