mf: Do not touch clock state when setting rate.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Nikolay Sivov 2020-03-11 14:19:44 +03:00 committed by Alexandre Julliard
parent 02613046ef
commit f5ace38adc
2 changed files with 6 additions and 1 deletions

View File

@ -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. */

View File

@ -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");