13
0

Fix thread-safety issue in a-fluidsynth.

This fix ensures that the a-fluidsynth "synth" object is not used in two
threads at the same time during midi event handling (run() in RT thread vs.
load_sf2() in worker thread), which could result in crashes.
This commit is contained in:
Stefan Westerfeld 2019-11-26 11:22:04 +01:00 committed by Robin Gareus
parent 7d8918034a
commit be1012d64e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -514,7 +514,7 @@ run (LV2_Handle instance, uint32_t n_samples)
}
}
else if (ev->body.type == self->midi_MidiEvent) {
if (ev->body.size > 3 || ev->time.frames >= n_samples) {
if (ev->body.size > 3 || ev->time.frames >= n_samples || self->reinit_in_progress) {
continue;
}