Skip to content

Commit

Permalink
ANDROID: Fix MIDI packet size
Browse files Browse the repository at this point in the history
Instruments are now not reset to the grand piano due to trailing
zeroes.
Thanks to waltervn for noticing this.
  • Loading branch information
dhewg committed Mar 26, 2011
1 parent cc074b0 commit 4176289
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions audio/softsynth/eas.cpp
Expand Up @@ -304,9 +304,13 @@ void MidiDriver_EAS::close() {
void MidiDriver_EAS::send(uint32 b) {
byte buf[4];

WRITE_UINT32(buf, b);
WRITE_LE_UINT32(buf, b);

int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, 4);
int32 len = 3;
if ((buf[0] >> 4) == 0xC || (buf[0] >> 4) == 0xD)
len = 2;

int32 res = _writeStreamFunc(_EASHandle, _midiStream, buf, len);
if (res)
warning("error writing to EAS MIDI stream: %d", res);
}
Expand Down

0 comments on commit 4176289

Please sign in to comment.