mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +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.
|
// `DynamicVstEvents` object first.
|
||||||
// HACK: Is there a cleaner way to do this, or a way to
|
// HACK: Is there a cleaner way to do this, or a way to
|
||||||
// avoid having to store temporary copies of this?
|
// avoid having to store temporary copies of this?
|
||||||
DynamicVstEvents* events;
|
std::lock_guard lock(next_buffer_midi_events_mutex);
|
||||||
{
|
DynamicVstEvents& events =
|
||||||
std::lock_guard lock(next_buffer_midi_events_mutex);
|
next_audio_buffer_midi_events.emplace_back(
|
||||||
events = &next_audio_buffer_midi_events.emplace_back(
|
|
||||||
*static_cast<const VstEvents*>(data));
|
*static_cast<const VstEvents*>(data));
|
||||||
}
|
|
||||||
|
|
||||||
return plugin->dispatcher(plugin, opcode, index, value,
|
return plugin->dispatcher(plugin, opcode, index, value,
|
||||||
&events->as_c_events(), option);
|
&events.as_c_events(), option);
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "[Warning] Received non-MIDI "
|
std::cerr << "[Warning] Received non-MIDI "
|
||||||
"event on MIDI processing thread"
|
"event on MIDI processing thread"
|
||||||
|
|||||||
Reference in New Issue
Block a user