mf: Return earlier for clock state change calls when time source is not set.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3bd1e1edf7
commit
4e8d7ece69
@ -1923,6 +1923,9 @@ static HRESULT clock_change_state(struct presentation_clock *clock, enum clock_c
|
|||||||
MFTIME system_time;
|
MFTIME system_time;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
|
if (!clock->time_source)
|
||||||
|
return MF_E_CLOCK_NO_TIME_SOURCE;
|
||||||
|
|
||||||
if (command != CLOCK_CMD_SET_RATE && clock->state == states[command] && clock->state != MFCLOCK_STATE_RUNNING)
|
if (command != CLOCK_CMD_SET_RATE && clock->state == states[command] && clock->state != MFCLOCK_STATE_RUNNING)
|
||||||
return MF_E_CLOCK_STATE_ALREADY_SET;
|
return MF_E_CLOCK_STATE_ALREADY_SET;
|
||||||
|
|
||||||
|
@ -1501,6 +1501,9 @@ static void test_presentation_clock(void)
|
|||||||
hr = MFCreatePresentationClock(&clock);
|
hr = MFCreatePresentationClock(&clock);
|
||||||
ok(hr == S_OK, "Failed to create presentation clock, hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to create presentation clock, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);
|
||||||
|
ok(hr == S_OK, "Failed to get rate control interface, hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMFPresentationClock_GetTimeSource(clock, &time_source);
|
hr = IMFPresentationClock_GetTimeSource(clock, &time_source);
|
||||||
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
@ -1521,7 +1524,7 @@ static void test_presentation_clock(void)
|
|||||||
|
|
||||||
value = 1;
|
value = 1;
|
||||||
hr = IMFPresentationClock_GetContinuityKey(clock, &value);
|
hr = IMFPresentationClock_GetContinuityKey(clock, &value);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to get continuity key, hr %#x.\n", hr);
|
||||||
ok(value == 0, "Unexpected value %u.\n", value);
|
ok(value == 0, "Unexpected value %u.\n", value);
|
||||||
|
|
||||||
hr = IMFPresentationClock_GetProperties(clock, &props);
|
hr = IMFPresentationClock_GetProperties(clock, &props);
|
||||||
@ -1559,6 +1562,19 @@ static void test_presentation_clock(void)
|
|||||||
hr = IMFPresentationClock_RemoveClockStateSink(clock, &test_sink);
|
hr = IMFPresentationClock_RemoveClockStateSink(clock, &test_sink);
|
||||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
/* State change commands, time source is not set yet. */
|
||||||
|
hr = IMFPresentationClock_Start(clock, 0);
|
||||||
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_Pause(clock);
|
||||||
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFPresentationClock_Stop(clock);
|
||||||
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
|
hr = IMFRateControl_SetRate(rate_control, FALSE, 0.0f);
|
||||||
|
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
/* Set default time source. */
|
/* Set default time source. */
|
||||||
hr = MFCreateSystemTimeSource(&time_source);
|
hr = MFCreateSystemTimeSource(&time_source);
|
||||||
ok(hr == S_OK, "Failed to create time source, hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to create time source, hr %#x.\n", hr);
|
||||||
@ -1631,9 +1647,6 @@ static void test_presentation_clock(void)
|
|||||||
|
|
||||||
IMFPresentationTimeSource_Release(time_source);
|
IMFPresentationTimeSource_Release(time_source);
|
||||||
|
|
||||||
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);
|
|
||||||
ok(hr == S_OK, "Failed to get rate control interface, hr %#x.\n", hr);
|
|
||||||
|
|
||||||
hr = IMFRateControl_GetRate(rate_control, NULL, &rate);
|
hr = IMFRateControl_GetRate(rate_control, NULL, &rate);
|
||||||
ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr);
|
ok(hr == S_OK, "Failed to get clock rate, hr %#x.\n", hr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user