mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Extend the midi event lock
This should not make any difference, but if this event ever gets called at the same time as the processing then this at least won't cause any issues with plugins that are not thread safe themselves.
This commit is contained in:
@@ -178,15 +178,13 @@ void PluginBridge::handle_dispatch() {
|
||||
// `DynamicVstEvents` object first.
|
||||
// HACK: Is there a cleaner way to do this, or a way to
|
||||
// avoid having to store temporary copies of this?
|
||||
DynamicVstEvents* events;
|
||||
{
|
||||
std::lock_guard lock(next_buffer_midi_events_mutex);
|
||||
events = &next_audio_buffer_midi_events.emplace_back(
|
||||
std::lock_guard lock(next_buffer_midi_events_mutex);
|
||||
DynamicVstEvents& events =
|
||||
next_audio_buffer_midi_events.emplace_back(
|
||||
*static_cast<const VstEvents*>(data));
|
||||
}
|
||||
|
||||
return plugin->dispatcher(plugin, opcode, index, value,
|
||||
&events->as_c_events(), option);
|
||||
&events.as_c_events(), option);
|
||||
} else {
|
||||
std::cerr << "[Warning] Received non-MIDI "
|
||||
"event on MIDI processing thread"
|
||||
|
||||
Reference in New Issue
Block a user