Commit 34ffec67 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf: Get presentation clock flags from current time source.

parent 0efb33c2
......@@ -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,
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment