Fix time info cache being applied to other opcodes

I don't know how I've never noticed this, but we should of course only
be handling `audioMasterGetTime()` this way. This also explains why
enabling this permanently in the past broke some plugins.
This commit is contained in:
Robbert van der Helm
2021-04-27 17:31:23 +02:00
parent 5a68b8b39d
commit b52362e698
2 changed files with 13 additions and 7 deletions
+2
View File
@@ -38,6 +38,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
fix, MIDI events are now deallocated later then when they normally would have
to be.
- Fixed _UVI Plugsound Free_ crashing during initialization.
- Fixed the `cache_time_info` `yabridge.toml` option also affecting the results
of other host callbacks during audio processing.
## [3.1.0] - 2021-04-15
+11 -7
View File
@@ -595,13 +595,17 @@ intptr_t Vst2Bridge::host_callback(AEffect* effect,
intptr_t value,
void* data,
float option) {
// HACK: Workaround for a bug in SWAM Cello where it would call
// `audioMasterGetTime()` once for every sample. When this option is
// enabled `time_info` should be reset in the process function. The
// `time_info` value is assigned inside of
// `HostCallbackDataConverter::write()`.
if (config.cache_time_info && time_info) {
return reinterpret_cast<intptr_t>(&*time_info);
switch (opcode) {
case audioMasterGetTime: {
// HACK: Workaround for a bug in SWAM Cello where it would call
// `audioMasterGetTime()` once for every sample. When this
// option is enabled `time_info` should be reset in the
// process function. The `time_info` value is assigned inside
// of `HostCallbackDataConverter::write()`.
if (config.cache_time_info && time_info) {
return reinterpret_cast<intptr_t>(&*time_info);
}
} break;
}
HostCallbackDataConverter converter(effect, time_info);