Gracefully ignore illegal MIDI events.

git-svn-id: svn://localhost/ardour2/branches/3.0@4591 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-02-16 00:36:11 +00:00
parent 473170200d
commit 85ab341795
4 changed files with 31 additions and 10 deletions

View file

@ -580,6 +580,11 @@ Sequence<Time>::append(const Event<Time>& event)
assert(_notes.empty() || ev.time() >= _notes.back()->time());
assert(_writing);
if (!midi_event_is_valid(ev.buffer(), ev.size())) {
cerr << "WARNING: Ignoring illegal MIDI event" << endl;
return;
}
if (ev.is_note_on()) {
append_note_on_unlocked(ev.channel(), ev.time(), ev.note(), ev.velocity());
} else if (ev.is_note_off()) {