Commit 6c8321ff authored by sletz's avatar sletz
Browse files

Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3841 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 57a2bd59
......@@ -26,6 +26,10 @@ Devin Anderson
Jackdmp changes log
---------------------------
2009-12-03 Stephane Letz <letz@grame.fr>
* Fix JackCoreMidiDriver::ReadProcAux when ring buffer is full (thanks Devin Anderson).
2009-12-02 Stephane Letz <letz@grame.fr>
* Special code in JackCoreAudio driver to handle completely buggy Digidesign CoreAudio user-land driver.
......
......@@ -52,19 +52,17 @@ void JackCoreMidiDriver::ReadProcAux(const MIDIPacketList *pktlist, jack_ringbuf
// TODO : use timestamp
// Check available size first..
size = jack_ringbuffer_write_space(ringbuffer);
if (size < (sizeof(UInt16) + packet->length)) {
jack_error("ReadProc : ring buffer is full, skip events...");
return;
}
// Write length of each packet first
size = jack_ringbuffer_write(ringbuffer, (char*)&packet->length, sizeof(UInt16));
if (size != sizeof(UInt16)) {
jack_error("ReadProc : ring buffer is full, skip events...");
return;
}
jack_ringbuffer_write(ringbuffer, (char*)&packet->length, sizeof(UInt16));
// Write event actual data
size = jack_ringbuffer_write(ringbuffer, (char*)packet->data, packet->length);
if (size != packet->length) {
jack_error("ReadProc : ring buffer is full, skip events...");
return;
}
jack_ringbuffer_write(ringbuffer, (char*)packet->data, packet->length);
packet = MIDIPacketNext(packet);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment