Allow host to not supply CV ports

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-05-17 19:48:58 +01:00
parent 946056b1fd
commit fa1e6a1343
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
2 changed files with 20 additions and 2 deletions

View file

@ -1148,7 +1148,13 @@ protected:
{
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
for (int i=0; i<DISTRHO_PLUGIN_NUM_INPUTS; ++i)
std::memcpy(fAudioBufferCopy[i], inputs[i], sizeof(float)*frames);
{
#if CARDINAL_VARIANT_MAIN
// can be null on main variant
if (inputs[i] != nullptr)
#endif
std::memcpy(fAudioBufferCopy[i], inputs[i], sizeof(float)*frames);
}
context->dataIns = fAudioBufferCopy;
#else
context->dataIns = nullptr;
@ -1157,7 +1163,13 @@ protected:
}
for (int i=0; i<DISTRHO_PLUGIN_NUM_OUTPUTS; ++i)
std::memset(outputs[i], 0, sizeof(float)*frames);
{
#if CARDINAL_VARIANT_MAIN
// can be null on main variant
if (outputs[i] != nullptr)
#endif
std::memset(outputs[i], 0, sizeof(float)*frames);
}
if (bypassed)
{