Fix VST state-lock SNAFU (effSetChunk and process are exclusive)
[ardour.git] / libs / fst / vstwin.c
index 7f748c6db65b1162ff4c8ef5954c77656efe0bf5..1e053d1ae7198272c108669f2ffd7e31c4c158d9 100644 (file)
@@ -92,8 +92,10 @@ maybe_set_program (VSTState* fst)
                // XXX check
                // 24 == audioMasterGetAutomationState,
                // 48 == audioMasterGetChunkFile
+               pthread_mutex_lock (&vstfx->state_lock);
                fst->plugin->dispatcher (fst->plugin, 24 /* effSetChunk */, 1, fst->wanted_chunk_size, fst->wanted_chunk, 0);
                fst->want_chunk = 0;
+               pthread_mutex_unlock (&vstfx->state_lock);
        }
 }