Set VST2 SR and block sizes from main thread

This apparently fixes New Sonic Arts' Vice plugin freezing while
loading. Hopefully this doesn't cause issues with other plugins. Spotted
in https://www.kvraudio.com/forum/viewtopic.php?p=8217647#p8217647.
This commit is contained in:
Robbert van der Helm
2021-09-21 14:11:15 +02:00
parent 31dc23963c
commit f26a2a2689
2 changed files with 12 additions and 2 deletions
+7 -2
View File
@@ -94,10 +94,15 @@ static const std::unordered_set<int> safe_mutually_recursive_requests{
* NOTE: `effSetChunk` and `effGetChunk` should be callable from any thread, but
* Algonaut Atlas doesn't restore chunk data unless `effSetChunk` is run
* from the GUI thread
* NOTE: `effSetSampleRate` and `effSetBlockSize` really shouldn't be here, but
* New Sonic Arts' Vice plugin spawns a new thread and calls drawing code
* while changing sample rate and block size. We'll need to see if doing
* this on the main thread introduces any regressions.
*/
static const std::unordered_set<int> unsafe_requests{
effOpen, effClose, effEditGetRect, effEditOpen, effEditClose,
effEditIdle, effEditTop, effMainsChanged, effGetChunk, effSetChunk};
effOpen, effClose, effEditGetRect, effEditOpen,
effEditClose, effEditIdle, effEditTop, effMainsChanged,
effGetChunk, effSetChunk, effSetSampleRate, effSetBlockSize};
/**
* These opcodes from `unsafe_requests` should be run under realtime scheduling