[PATCH 12/25] mciseq: Play returns the error code from midiOutOpen.

Joerg-Cyril.Hoehle at t-systems.com Joerg-Cyril.Hoehle at t-systems.com
Thu Oct 4 07:12:27 CDT 2012


Hi,

that's an important change w.r.t. compatibility.  Native's Play
command takes a lot of time and obviously opens the MIDI interface,
possibly returning an error.  The old Wine driver would
process the play command without error yet the player might
not be able to play anything.  That was not what apps expected.

+	    HANDLE events[2] = {wmm->hEvent, wmm->hThread};
+	    if (WaitForMultipleObjects(2, events, FALSE, INFINITE) == WAIT_OBJECT_0+1) {
+		GetExitCodeThread(wmm->hThread, &dwRet);
Ordering events[2] is essential.  Both are signaled when midiOutOpen
was successful and the player finished fast (or crashed).
Wait* is specified to yield the first event in such a case: WAIT_OBJECT_0
but then we're not interested in the error code. We only want it when
SetEvent(wmm->hEvent) was not encountered.


That's today's last patch, although 13-25 are ready.
I plan to send the rest tomorrow.  You can choose to
commit 1-12 now and the rest later or wait to see them all.  They
are typically stand-alone patches, yet ordering is essential. They are:

0013-mciseq-Correct-MCI_SEEK-return-codes
0014-mciseq-Fix-some-MCIERROR_-codes-MCI_STATUS
0015-mciseq-Fix-some-MCIERROR_-codes-related-to-auto-open
0016-mciseq-Fix-reading-MCI_INFO_NAME-and-COPYRIGHT-from-file
0017-winmm-tests-Add-initial-set-of-MCI-MIDI-tests
0018-winmm-tests-Add-more-MCI-MIDI-tests-auto-open
0019-mciseq-Remove-unneeded-includes
0020-mciseq-Check-stop-condition-after-sleeping
0021-mciseq-Remain-responsive-while-processing-large-deltas
0022-mciseq-The-code-can-only-handle-upto-128-MIDI-tracks
0023-mciseq-MCI_PLAY-does-not-reset-the-tempo-to-default
0024-mciseq-Read-the-tempo-from-the-file-when-opening-it
0025-mciseq-MCI-tempo-is-expressed-in-beats-per-minute

Regards,
	Jörg Höhle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0012-mciseq-Play-returns-the-error-code-from-midiOutOpen.patch
Type: application/octet-stream
Size: 1975 bytes
Desc: 0012-mciseq-Play-returns-the-error-code-from-midiOutOpen.patch
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20121004/37af003f/attachment.obj>


More information about the wine-patches mailing list