1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Recover from messages not handled by the device

When an underlying MIDI device does not understand/support a MIDI message (very common with sysex messages) it returns an error code.
With this fix MIDI output can continue gracefully even after an emulated game sends an unsupported message.
This commit is contained in:
Bernhard Schelling 2021-01-13 02:07:21 +09:00 committed by GitHub
parent 0ce218e20a
commit 4fcace9aed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -605,6 +605,10 @@ static bool winmm_midi_flush(void *p)
#ifdef DEBUG
RARCH_ERR("[MIDI]: midiStreamOut failed with error %d.\n", mmr);
#endif
// Core sent MIDI message not understood by the MIDI driver
// Make this buffer available to be used again
buf->header.dwFlags |= MHDR_DONE;
buf->header.dwFlags &= ~MHDR_INQUEUE;
return false;
}