Fix LV2 buffersize option interface

https://lv2plug.in/doc/html/group__options.html specifies
a NULL terminated array of options (not a single option).

Since the call is the "instantiation" LV2 threading class, and
a single fixed value is passed with a direct call into the
plugin, using a stack-allocated LV2_Options_Option is sufficient.
This commit is contained in:
Robin Gareus 2020-07-16 15:57:42 +02:00
parent 4b1a41ff53
commit baa8cd1b52
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -954,11 +954,12 @@ LV2Plugin::set_block_size (pframes_t nframes)
if (_impl->opts_iface) {
LV2_URID atom_Int = _uri_map.uri_to_id(LV2_ATOM__Int);
_impl->block_length = nframes;
LV2_Options_Option block_size_option = {
LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id ("http://lv2plug.in/ns/ext/buf-size#nominalBlockLength"),
sizeof(int32_t), atom_Int, (void*)&_impl->block_length
LV2_Options_Option block_size_option[] = {
{ LV2_OPTIONS_INSTANCE, 0, _uri_map.uri_to_id ("http://lv2plug.in/ns/ext/buf-size#nominalBlockLength"),
sizeof(int32_t), atom_Int, (void*)&_impl->block_length},
{ LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, NULL }
};
_impl->opts_iface->set (_impl->instance->lv2_handle, &block_size_option);
_impl->opts_iface->set (_impl->instance->lv2_handle, block_size_option);
}
return 0;