MIDIDecoder bug fixes

This commit is contained in:
Jack Andersen 2016-06-22 11:44:37 -10:00
parent 315998381c
commit e4c625c55a
1 changed files with 121 additions and 107 deletions

View File

@ -51,6 +51,19 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
else else
it--; it--;
if (m_status == 0xff)
{
/* Meta events (ignored for now) */
if (it == end)
return begin;
a = *it++;
uint32_t length;
_readContinuedValue(it, end, length);
it += length;
}
else
{
uint8_t chan = m_status & 0xf; uint8_t chan = m_status & 0xf;
switch (Status(m_status & 0xf0)) switch (Status(m_status & 0xf0))
{ {
@ -188,6 +201,7 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
} }
default: break; default: break;
} }
}
return it; return it;
} }