Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surrounded all std::err calls regarding message queue limit reached with debug check to prevent flooding of output console #244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions RtMidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,12 @@ static void midiInputCallback( const MIDIPacketList *list, void *procRef, void *
}
else {
// As long as we haven't reached our queue size limit, push the message.
if ( !data->queue.push( message ) )
if (!data->queue.push(message))
{
#if defined(__RTMIDI_DEBUG__)
std::cerr << "\nMidiInCore: message queue limit reached!!\n\n";
#endif
}
}
message.bytes.clear();
}
Expand Down Expand Up @@ -888,8 +892,12 @@ static void midiInputCallback( const MIDIPacketList *list, void *procRef, void *
}
else {
// As long as we haven't reached our queue size limit, push the message.
if ( !data->queue.push( message ) )
if (!data->queue.push(message))
{
#if defined(__RTMIDI_DEBUG__)
std::cerr << "\nMidiInCore: message queue limit reached!!\n\n";
#endif
}
}
message.bytes.clear();
}
Expand Down Expand Up @@ -1725,8 +1733,12 @@ static void *alsaMidiHandler( void *ptr )
}
else {
// As long as we haven't reached our queue size limit, push the message.
if ( !data->queue.push( message ) )
if (!data->queue.push(message))
{
#if defined(__RTMIDI_DEBUG__)
std::cerr << "\nMidiInAlsa: message queue limit reached!!\n\n";
#endif
}
}
}

Expand Down Expand Up @@ -2529,8 +2541,12 @@ static void CALLBACK midiInputCallback( HMIDIIN /*hmin*/,
}
else {
// As long as we haven't reached our queue size limit, push the message.
if ( !data->queue.push( apiData->message ) )
if (!data->queue.push(apiData->message))
{
#if defined(__RTMIDI_DEBUG__)
std::cerr << "\nMidiInWinMM: message queue limit reached!!\n\n";
#endif
}
}

// Clear the vector for the next input message.
Expand Down Expand Up @@ -3070,8 +3086,12 @@ static int jackProcessIn( jack_nframes_t nframes, void *arg )
}
else {
// As long as we haven't reached our queue size limit, push the message.
if ( !rtData->queue.push( message ) )
if (!rtData->queue.push(message))
{
#if defined(__RTMIDI_DEBUG__)
std::cerr << "\nMidiInJack: message queue limit reached!!\n\n";
#endif
}
}
}
}
Expand Down