[PATCH 3/6] mf: Get presentation clock flags from current time source.

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


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

diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index 76573c9f44..9c2826f8e5 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -841,9 +841,19 @@ static ULONG WINAPI present_clock_Release(IMFPresentationClock *iface)
 
 static HRESULT WINAPI present_clock_GetClockCharacteristics(IMFPresentationClock *iface, DWORD *flags)
 {
-    FIXME("%p, %p.\n", iface, flags);
+    struct presentation_clock *clock = impl_from_IMFPresentationClock(iface);
+    HRESULT hr;
 
-    return E_NOTIMPL;
+    TRACE("%p, %p.\n", iface, flags);
+
+    EnterCriticalSection(&clock->cs);
+    if (clock->time_source)
+        hr = IMFPresentationTimeSource_GetClockCharacteristics(clock->time_source, flags);
+    else
+        hr = MF_E_CLOCK_NO_TIME_SOURCE;
+    LeaveCriticalSection(&clock->cs);
+
+    return hr;
 }
 
 static HRESULT WINAPI present_clock_GetCorrelatedTime(IMFPresentationClock *iface, DWORD reserved,
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 39a049000f..e07c82486b 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -1449,7 +1449,6 @@ static void test_presentation_clock(void)
     ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
 
     hr = IMFPresentationClock_GetClockCharacteristics(clock, &value);
-todo_wine
     ok(hr == MF_E_CLOCK_NO_TIME_SOURCE, "Unexpected hr %#x.\n", hr);
 
     value = 1;
@@ -1491,9 +1490,19 @@ todo_wine
     hr = MFCreateSystemTimeSource(&time_source);
     ok(hr == S_OK, "Failed to create time source, hr %#x.\n", hr);
 
+    hr = IMFPresentationTimeSource_GetClockCharacteristics(time_source, &value);
+    ok(hr == S_OK, "Failed to get time source flags, hr %#x.\n", hr);
+    ok(value == (MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ | MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK),
+            "Unexpected clock flags %#x.\n", value);
+
     hr = IMFPresentationClock_SetTimeSource(clock, time_source);
     ok(hr == S_OK, "Failed to set time source, hr %#x.\n", hr);
 
+    hr = IMFPresentationClock_GetClockCharacteristics(clock, &value);
+    ok(hr == S_OK, "Failed to get clock flags, hr %#x.\n", hr);
+    ok(value == (MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ | MFCLOCK_CHARACTERISTICS_FLAG_IS_SYSTEM_CLOCK),
+            "Unexpected clock flags %#x.\n", value);
+
     /* State changes. */
     for (i = 0; i < ARRAY_SIZE(clock_state_change); ++i)
     {
-- 
2.20.1




More information about the wine-devel mailing list