diff --git a/CHANGELOG.md b/CHANGELOG.md index 989b9219..17202753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index 6c0adbf4..a2af16e6 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -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(&*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(&*time_info); + } + } break; } HostCallbackDataConverter converter(effect, time_info);