From 09a4dcee68d3c4b8c0b5f43bcbf8ec2dd6977b41 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 15 Oct 2020 20:45:26 +0200 Subject: [PATCH] VST3: fix controller state restore This partially reverts 9e7cfdd8806be9, VST3 host-checker uses complete state for the controller. --- libs/ardour/vst3_plugin.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index e65adf4c38..535b8f68bb 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -2235,8 +2235,9 @@ VST3PI::load_state (RAMStream& stream) } } else if (is_equal_ID (i->_id, Vst::getChunkID (Vst::kControllerState))) { - ROMStream s (stream, i->_offset, i->_size); - tresult res = _controller->setState (&s); + assert (FUnknownPtr (_component) == 0); + stream.seek (i->_offset, IBStream::kIBSeekSet, &seek_result); + tresult res = _controller->setState (&stream); if (!(res == kResultOk || res == kNotImplemented)) { DEBUG_TRACE (DEBUG::VST3Config, "VST3PI::load_state: failed to restore controller state\n"); rv = false;