Nikolay Sivov : mf: Get presentation clock flags from current time source.
Alexandre Julliard
julliard at winehq.org
Fri May 31 15:53:31 CDT 2019
Module: wine
Branch: master
Commit: 34ffec67a79114a13c928bb87f5fbe605816ed39
URL: https://source.winehq.org/git/wine.git/?a=commit;h=34ffec67a79114a13c928bb87f5fbe605816ed39
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri May 31 13:11:30 2019 +0300
mf: Get presentation clock flags from current time source.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 76573c9..9c2826f 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 39a0490..e07c824 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)
{
More information about the wine-cvs
mailing list