Commit 446c0824 authored by sletz's avatar sletz
Browse files

Small improvement in JackCoreMidiDriver::ReadProcAux.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3998 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 159ce1a5
......@@ -40,11 +40,13 @@ static MIDITimeStamp MIDIGetCurrentHostTime()
void JackCoreMidiDriver::ReadProcAux(const MIDIPacketList *pktlist, jack_ringbuffer_t* ringbuffer)
{
// Write the number of packets
size_t size = jack_ringbuffer_write(ringbuffer, (char*)&pktlist->numPackets, sizeof(UInt32));
if (size != sizeof(UInt32)) {
size_t size = jack_ringbuffer_write_space(ringbuffer);
if (size < sizeof(UInt32)) {
jack_error("ReadProc : ring buffer is full, skip events...");
return;
}
}
jack_ringbuffer_write(ringbuffer, (char*)&pktlist->numPackets, sizeof(UInt32));
for (unsigned int i = 0; i < pktlist->numPackets; ++i) {
......
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