Always honor CLAP main thread requirement

If this ever becomes a bottleneck we can always decide to not do it
right there and then.
This commit is contained in:
Robbert van der Helm
2022-09-13 18:16:37 +02:00
parent d5f4d563d4
commit 168837c8ac
2 changed files with 69 additions and 53 deletions
+10 -6
View File
@@ -88,12 +88,16 @@ ClapPluginBridge::ClapPluginBridge(const ghc::filesystem::path& plugin_path)
const auto& [plugin_proxy, _] =
get_proxy(request.owner_instance_id);
// We'll ignore the main thread requirement for
// simple lookup functions like this for
// performance's sake
return plugin_proxy.extensions_.audio_ports
->is_rescan_flag_supported(plugin_proxy.host_,
request.flag);
return plugin_proxy
.run_on_main_thread(
[&, host = plugin_proxy.host_,
audio_ports = plugin_proxy.extensions_
.audio_ports]() {
return audio_ports
->is_rescan_flag_supported(
host, request.flag);
})
.get();
},
[&](const clap::ext::audio_ports::host::Rescan& request)
-> clap::ext::audio_ports::host::Rescan::Response {