diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-28 22:16:59 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-28 22:16:59 +0200 |
commit | 2199efa523f8d0ba2a4776966087f3ccf4d1c9e7 (patch) | |
tree | 510cdc4c61184295fa950c28442df40f52be6ff2 /pluginlv2.cc | |
parent | b4103bd5a37e5da1429d723fb5c5d7e28385ff23 (diff) |
Fix midi event iteration loop when encountering a non-midi event.
Diffstat (limited to 'pluginlv2.cc')
-rw-r--r-- | pluginlv2.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pluginlv2.cc b/pluginlv2.cc index 477f30a..39d0e6c 100644 --- a/pluginlv2.cc +++ b/pluginlv2.cc @@ -301,10 +301,9 @@ void PluginLV2::run(LV2_Handle instance, uint32_t sample_count) auto& event_port = plugin_lv2->input_event_ports[port]; - LV2_Atom_Event* ev = lv2_atom_sequence_begin(&event_port->body); - while(!lv2_atom_sequence_is_end(&event_port->body, - event_port->atom.size, - ev)) + for(LV2_Atom_Event* ev = lv2_atom_sequence_begin(&event_port->body); + !lv2_atom_sequence_is_end(&event_port->body, event_port->atom.size, ev); + ev = lv2_atom_sequence_next(ev)) { if(ev->body.type != plugin_lv2->map->map(plugin_lv2->map->handle, LV2_MIDI__MidiEvent)) @@ -314,8 +313,6 @@ void PluginLV2::run(LV2_Handle instance, uint32_t sample_count) const char* data = (char*)(ev + 1); input_events.emplace_back(ev->time.frames, data, ev->body.size); - - ev = lv2_atom_sequence_next(ev); } } |