Browse Source

Sequencer: Don't leak from the output buffer when suppressing duplicate noteon/offs.

tags/non-daw-v1.2.0
Jonathan Moore Liles 13 years ago
parent
commit
9a80f4c3f3
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      sequencer/src/jack.C

+ 13
- 5
sequencer/src/jack.C View File

@@ -121,17 +121,18 @@ midi_output_event ( int port, const midievent *e )
event *fe = freelist.first();

if ( ! fe )
{
WARNING( "output buffer underrun" );
}
else
{
freelist.unlink( fe );

*fe = *e;
if ( e->is_note_on() )
{
if ( notes_on[ port ][ e->channel() ][ e->note() ] == 0 )
{
freelist.unlink( fe );
*fe = *e;

output[ port ].events.insert( fe );
++notes_on[ port ][ e->channel() ][ e->note() ];
}
@@ -148,13 +149,20 @@ midi_output_event ( int port, const midievent *e )
}
else
{
output[ port ].events.insert( fe );
freelist.unlink( fe );
*fe = *e;

output[ port ].events.insert( fe );
--notes_on[ port ][ e->channel() ][ e->note() ];
}
}
else
{
freelist.unlink( fe );
*fe = *e;

output[ port ].events.insert( fe );
}
}
}



Loading…
Cancel
Save