Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/session.c | 3 ++- dlls/mf/tests/mf.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 933cdf5c93..cc014f548a 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2978,7 +2978,8 @@ static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_c return hr;
old_state = clock->state; - clock->state = states[command]; + if (command != CLOCK_CMD_SET_RATE) + clock->state = states[command];
/* Dump all pending timer requests immediately on start; otherwise try to cancel scheduled items when transitioning from running state. */ diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index a86a8ecdbb..a9b0ee34a3 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1797,6 +1797,10 @@ static void test_presentation_clock(void) hr = IMFRateControl_SetRate(rate_control, TRUE, -1.0f); ok(hr == MF_E_THINNING_UNSUPPORTED, "Unexpected hr %#x.\n", hr);
+ hr = IMFPresentationClock_GetState(clock, 0, &state); + ok(hr == S_OK, "Failed to get clock state, hr %#x.\n", hr); + ok(state == MFCLOCK_STATE_RUNNING, "Unexpected state %d.\n", state); + hr = IMFRateControl_GetRate(rate_control, &thin, &rate); ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr); ok(rate == 0.5f, "Unexpected rate.\n");