On Tue, Jun 26, 2018 at 10:10:52PM +0900, Akihiro Sagawa wrote:
diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index 023f5c5..60d56a4 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -1514,14 +1514,23 @@ MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbm } else { EnterCriticalSection(&lpMidiStrm->lock); switch (lpMMT->wType) {
- default:
FIXME("Unsupported time type %x\n", lpMMT->wType);
/* fall through */
- case TIME_MIDI:
if (lpMidiStrm->dwTimeDiv < 0x8000) {
DWORD tdiv, pulses;
tdiv = (lpMidiStrm->dwTimeDiv > 24) ? lpMidiStrm->dwTimeDiv : 24;
pulses = midistream_get_current_pulse(lpMidiStrm);
lpMMT->u.midi.songptrpos = (pulses + tdiv/8) / (tdiv/4);
if (!lpMMT->u.midi.songptrpos && pulses) lpMMT->u.midi.songptrpos++;
TRACE("=> song position %d (pulses %u, tdiv %u)\n", lpMMT->u.midi.songptrpos, pulses, tdiv);
break;
}
- /* fall through */ case TIME_BYTES: case TIME_SAMPLES: lpMMT->wType = TIME_MS; /* fall through to alternative format */ case TIME_MS:
- in_ms: lpMMT->u.ms = midistream_get_playing_position(lpMidiStrm); TRACE("=> %d ms\n", lpMMT->u.ms); break;
@@ -1529,6 +1538,10 @@ MMRESULT WINAPI midiStreamPosition(HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbm lpMMT->u.ticks = midistream_get_current_pulse(lpMidiStrm); TRACE("=> %d ticks\n", lpMMT->u.ticks); break;
- default:
FIXME("Unsupported time type %x\n", lpMMT->wType);
lpMMT->wType = TIME_MS;
} LeaveCriticalSection(&lpMidiStrm->lock); }goto in_ms;
This goto is awkward, can you come up with a better way?
Andrew