Module: wine Branch: master Commit: f5ace38adc2c09f9e63431a514c4845f088369cb URL: https://source.winehq.org/git/wine.git/?a=commit;h=f5ace38adc2c09f9e63431a51...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Wed Mar 11 14:19:44 2020 +0300
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
---
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");