Commit 38404439 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

winmm: Reset the tick counter after handling messages.

Otherwise, events might be triggered immediately after a resuming. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAndrew Eikum <aeikum@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2e2ff805
......@@ -893,7 +893,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
expected = 250; /* = 12 ticks in 120 BPM */
ret = get_position(hm, TIME_MS);
todo_wine ok(ret >= expected - MARGIN && ret <= expected + MARGIN,
ok(ret >= expected - MARGIN && ret <= expected + MARGIN,
"expected greater than %ums, got %ums\n", expected, ret);
trace("after playing, got %ums\n", ret);
......@@ -914,7 +914,7 @@ static void test_midiStream(UINT udev, HWND hwnd)
So, the second event happens at dwDeltaTime(250ms) + 100ms after the first event. */
expected = 250 + 100;
diff = records.time_stamp[1] - records.time_stamp[0];
todo_wine ok(diff >= expected - MARGIN && diff <= expected + MARGIN,
ok(diff >= expected - MARGIN && diff <= expected + MARGIN,
"expected %u ~ %ums, got %ums (dev=%d)\n", expected - MARGIN, expected + MARGIN, diff, udev);
rc = midiOutUnprepareHeader((HMIDIOUT)hm, &mhdr, sizeof(mhdr));
......
......@@ -1197,6 +1197,8 @@ start_header:
goto start_header;
}
}
/* reset dwToGo because dwStartTicks might be updated */
dwToGo = lpMidiStrm->dwStartTicks + lpMidiStrm->dwPositionMS;
} else {
/* timeout, so me->dwDeltaTime is elapsed, can break the while loop */
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment