Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit a751017

Browse files
walker-WSHjp9000
authored andcommitted
obs-vst: Clear VST effect if user selects empty plugin
1 parent 0fb0401 commit a751017

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

VSTPlugin.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ void VSTPlugin::cleanupChannelBuffers()
133133
void VSTPlugin::loadEffectFromPath(std::string path)
134134
{
135135
if (this->pluginPath.compare(path) != 0) {
136-
closeEditor();
137136
unloadEffect();
138137
blog(LOG_INFO, "User selected new VST plugin: '%s'", path.c_str());
139138
}
@@ -264,6 +263,8 @@ obs_audio_data *VSTPlugin::process(struct obs_audio_data *audio)
264263

265264
void VSTPlugin::unloadEffect()
266265
{
266+
closeEditor();
267+
267268
{
268269
std::lock_guard<std::recursive_mutex> lock(lockEffect);
269270

@@ -279,6 +280,8 @@ void VSTPlugin::unloadEffect()
279280
}
280281

281282
unloadLibrary();
283+
284+
pluginPath = "";
282285
}
283286

284287
bool VSTPlugin::isEditorOpen()

obs-vst.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static void vst_update(void *data, obs_data_t *settings)
9999
const char *path = obs_data_get_string(settings, "plugin_path");
100100

101101
if (strcmp(path, "") == 0) {
102+
vstPlugin->unloadEffect();
102103
return;
103104
}
104105
vstPlugin->loadEffectFromPath(std::string(path));

0 commit comments

Comments
 (0)