Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 127 (crash in validator) #130

Merged
merged 5 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/detail/vst3/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,21 @@ bool ProcessAdapter::enqueueOutputEvent(const clap_event_header_t* event)
Steinberg::int32 index = 0;
// addParameterData() does check if there is already a queue and returns it,
// actually, it should be called getParameterQueue()
auto list = _vstdata->outputParameterChanges->addParameterData(param_id, index);

// the implementation of addParameterData() in the SDK always returns a queue, but Cubase 12 (perhaps others, too)
// sometimes don't return a queue object during the first bunch of process calls. I (df) haven't figured out, why.
// therefore we have to check if there is an output queue at all
if (list)
// the vst3 validator from the VST3 SDK does not provide always an object to output parameters, probably other hosts won't to that, too
// therefore we are cautious.
if (_vstdata->outputParameterChanges)
{
Steinberg::int32 index2 = 0;
list->addPoint(ev->header.time, param->asVst3Value(ev->value), index2);
auto list = _vstdata->outputParameterChanges->addParameterData(param_id, index);

// the implementation of addParameterData() in the SDK always returns a queue, but Cubase 12 (perhaps others, too)
// sometimes don't return a queue object during the first bunch of process calls. I (df) haven't figured out, why.
// therefore we have to check if there is an output queue at all
if (list)
{
Steinberg::int32 index2 = 0;
list->addPoint(ev->header.time, param->asVst3Value(ev->value), index2);
}
}
}
}
Expand Down