[Scummvm-cvs-logs] scummvm master -> 3b2c3907a068fa0cea366a5e1cf47a23abb170ca
eriktorbjorn
eriktorbjorn at telia.com
Sun May 8 07:36:29 CEST 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3b2c3907a0 ALSA: Warn if events or SysEx messages are received when not open.
Commit: 3b2c3907a068fa0cea366a5e1cf47a23abb170ca
https://github.com/scummvm/scummvm/commit/3b2c3907a068fa0cea366a5e1cf47a23abb170ca
Author: eriktorbjorn (eriktorbjorn at users.sourceforge.net)
Date: 2011-05-07T22:34:46-07:00
Commit Message:
ALSA: Warn if events or SysEx messages are received when not open.
This should make it easier to spot errors like the one spotted in
the Queen engine yesterday. The Windows MIDI driver already seems
to do something like this; I don't know about the others.
Changed paths:
backends/midi/alsa.cpp
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 5110734..bc8fab6 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -183,6 +183,11 @@ void MidiDriver_ALSA::close() {
}
void MidiDriver_ALSA::send(uint32 b) {
+ if (!_isOpen) {
+ warning("MidiDriver_ALSA: Got event while not open");
+ return;
+ }
+
unsigned int midiCmd[4];
ev.type = SND_SEQ_EVENT_OSS;
@@ -256,6 +261,11 @@ void MidiDriver_ALSA::send(uint32 b) {
}
void MidiDriver_ALSA::sysEx(const byte *msg, uint16 length) {
+ if (!_isOpen) {
+ warning("MidiDriver_ALSA: Got SysEx while not open");
+ return;
+ }
+
unsigned char buf[266];
assert(length + 2 <= ARRAYSIZE(buf));
More information about the Scummvm-git-logs
mailing list