mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user