Browse files

Devin Anderson patch for Jack/CoreMIDI duplicated messages.

  • Loading branch information...
1 parent a176212 commit e6ab5e1803c5489acf9c2e0cbcce02903a043b1e @sletz sletz committed Aug 3, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 macosx/coremidi/JackCoreMidiOutputPort.cpp
View
11 macosx/coremidi/JackCoreMidiOutputPort.cpp
@@ -81,7 +81,11 @@ JackCoreMidiOutputPort::Execute()
packet = MIDIPacketListAdd(packet_list, PACKET_BUFFER_SIZE, packet,
timestamp, size, data);
if (packet) {
- while (GetMicroSeconds() < send_time) {
+ do {
+ if (GetMicroSeconds() >= send_time) {
+ event = 0;
+ break;
+ }
event = GetCoreMidiEvent(false);
if (! event) {
break;
@@ -90,10 +94,7 @@ JackCoreMidiOutputPort::Execute()
packet,
GetTimeStampFromFrames(event->time),
event->size, event->buffer);
- if (! packet) {
- break;
- }
- }
+ } while (packet);
SendPacketList(packet_list);
} else {

0 comments on commit e6ab5e1

Please sign in to comment.