diff options
-rw-r--r-- | src/jalv.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -472,8 +472,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) i = lv2_evbuf_next(i)) { uint32_t frames, subframes, type, size; uint8_t* data; - lv2_evbuf_get(i, &frames, &subframes, - &type, &size, &data); + lv2_evbuf_get(i, &frames, &subframes, &type, &size, &data); assert(size > 0); // FIXME: check type jack_midi_event_write(buf, frames, data, size); @@ -488,6 +487,10 @@ jack_process_cb(jack_nframes_t nframes, void* data) LV2_Atom* atom = (LV2_Atom*)ev->body; atom->type = type; atom->size = size; + if (jack_ringbuffer_write_space(host->plugin_events) + < sizeof(buf) + size) { + break; + } jack_ringbuffer_write(host->plugin_events, buf, sizeof(buf)); /* TODO: race, ensure reader handles this correctly */ jack_ringbuffer_write(host->plugin_events, (void*)data, size); |