Browse Source

Fix VST3 plugins not caring about incomplete reads

Signed-off-by: falkTX <falktx@falktx.com>
pull/1780/head
falkTX 1 year ago
parent
commit
37a34ce606
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      source/backend/plugin/CarlaPluginVST3.cpp

+ 5
- 3
source/backend/plugin/CarlaPluginVST3.cpp View File

@@ -401,7 +401,6 @@ private:
carla_v3_bstream* const stream = *static_cast<carla_v3_bstream**>(self);
CARLA_SAFE_ASSERT_RETURN(buffer != nullptr, V3_INVALID_ARG);
CARLA_SAFE_ASSERT_RETURN(num_bytes > 0, V3_INVALID_ARG);
CARLA_SAFE_ASSERT_RETURN(bytes_read != nullptr, V3_INVALID_ARG);
CARLA_SAFE_ASSERT_RETURN(stream->canRead, V3_INVALID_ARG);

if (stream->readPos + num_bytes > stream->size)
@@ -409,7 +408,10 @@ private:

std::memcpy(buffer, static_cast<uint8_t*>(stream->buffer) + stream->readPos, num_bytes);
stream->readPos += num_bytes;
*bytes_read = num_bytes;

// this is nasty, some plugins do not care about incomplete reads!
if (bytes_read != nullptr)
*bytes_read = num_bytes;

return V3_OK;
}
@@ -429,7 +431,7 @@ private:
stream->buffer = newbuffer;
stream->size += num_bytes;

// this is nasty, VST3s using JUCE do not care about incomplete writes!
// this is nasty, some plugins do not care about incomplete writes!
if (bytes_read != nullptr)
*bytes_read = num_bytes;



Loading…
Cancel
Save