Skip to content

Commit

Permalink
[jack] Fix sysex handling for large sysexes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jul 17, 2023
1 parent ddaf180 commit 2a1a33a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/libremidi/backends/jack/midi_in.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,10 @@ class midi_in_jack final
uint32_t evCount = jack_midi_get_event_count(buff);
for (uint32_t j = 0; j < evCount; j++)
{
message m;
message& m = jData.rtMidiIn->message;

jack_midi_event_get(&event, buff, j);

m.bytes.assign(event.buffer, event.buffer + event.size);

// Compute the delta time.
time = jack_get_time();
if (rtData.firstMessage == true)
Expand All @@ -209,8 +207,7 @@ class midi_in_jack final
{
// Unless this is a (possibly continued) SysEx message and we're ignoring SysEx,
// copy the event buffer into the MIDI message struct.
for (unsigned int i = 0; i < event.size; i++)
m.bytes.push_back(event.buffer[i]);
m.bytes.insert(m.bytes.end(), event.buffer, event.buffer + event.size);
}

switch (event.buffer[0])
Expand Down

0 comments on commit 2a1a33a

Please sign in to comment.