[PATCH 6/6] mf: Forward GetCorrelatedTime() to time source.

Nikolay Sivov nsivov at codeweavers.com
Fri May 31 05:11:33 CDT 2019


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/mf/session.c  | 12 ++++++++++--
 dlls/mf/tests/mf.c | 11 ++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index be5ea642d4..8e41942448 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -857,9 +857,17 @@ static HRESULT WINAPI present_clock_GetClockCharacteristics(IMFPresentationClock
 static HRESULT WINAPI present_clock_GetCorrelatedTime(IMFPresentationClock *iface, DWORD reserved,
         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)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index dc58dc1efd..8f9a97d497 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -1476,7 +1476,12 @@ static void test_presentation_clock(void)
     ok(state == MFCLOCK_STATE_INVALID, "Unexpected state %d.\n", state);
 
     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);
 
     /* Sinks. */
@@ -1564,6 +1569,10 @@ todo_wine
     ok(hr == S_OK, "Failed to get time source time, hr %#x.\n", hr);
     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);
 
     hr = IMFPresentationClock_QueryInterface(clock, &IID_IMFRateControl, (void **)&rate_control);
-- 
2.20.1




More information about the wine-devel mailing list