mf: Forward GetCorrelatedTime() to time source.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-05-31 13:11:33 +03:00 committed by Alexandre Julliard
parent f8537c5acd
commit 2bc81c53a7
2 changed files with 20 additions and 3 deletions

View File

@ -857,9 +857,17 @@ static HRESULT WINAPI present_clock_GetClockCharacteristics(IMFPresentationClock
static HRESULT WINAPI present_clock_GetCorrelatedTime(IMFPresentationClock *iface, DWORD reserved, static HRESULT WINAPI present_clock_GetCorrelatedTime(IMFPresentationClock *iface, DWORD reserved,
LONGLONG *clock_time, MFTIME *system_time) LONGLONG *clock_time, MFTIME *system_time)
{ {
FIXME("%p, %#x, %p, %p.\n", iface, reserved, clock_time, system_time); struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
HRESULT hr = MF_E_CLOCK_NO_TIME_SOURCE;
return E_NOTIMPL; TRACE("%p, %#x, %p, %p.\n", iface, reserved, clock_time, system_time);
EnterCriticalSection(&clock->cs);
if (clock->time_source)
hr = IMFPresentationTimeSource_GetCorrelatedTime(clock->time_source, reserved, clock_time, system_time);
LeaveCriticalSection(&clock->cs);
return hr;
} }
static HRESULT WINAPI present_clock_GetContinuityKey(IMFPresentationClock *iface, DWORD *key) static HRESULT WINAPI present_clock_GetContinuityKey(IMFPresentationClock *iface, DWORD *key)

View File

@ -1476,7 +1476,12 @@ static void test_presentation_clock(void)
ok(state == MFCLOCK_STATE_INVALID, "Unexpected state %d.\n", state); ok(state == MFCLOCK_STATE_INVALID, "Unexpected state %d.\n", state);
hr = IMFPresentationClock_GetCorrelatedTime(clock, 0, &clock_time, &systime); hr = IMFPresentationClock_GetCorrelatedTime(clock, 0, &clock_time, &systime);
todo_wine ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationClock_GetCorrelatedTime(clock, 0, NULL, &systime);
ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
hr = IMFPresentationClock_GetCorrelatedTime(clock, 0, &time, NULL);
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);
/* Sinks. */ /* Sinks. */
@ -1564,6 +1569,10 @@ todo_wine
ok(hr == S_OK, "Failed to get time source time, hr %#x.\n", hr); ok(hr == S_OK, "Failed to get time source time, hr %#x.\n", hr);
ok(time == clock_time, "Unexpected clock time.\n"); ok(time == clock_time, "Unexpected clock time.\n");
hr = IMFPresentationClock_GetCorrelatedTime(clock, 0, &time, &systime);
ok(hr == S_OK, "Failed to get clock time, hr %#x.\n", hr);
ok(time == clock_time, "Unexpected clock time.\n");
IMFPresentationTimeSource_Release(time_source); IMFPresentationTimeSource_Release(time_source);
hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control); hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);