Nikolay Sivov : mf: Forward GetCorrelatedTime() to time source.
Alexandre Julliard
julliard at winehq.org
Fri May 31 15:53:31 CDT 2019
Module: wine
Branch: master
Commit: 2bc81c53a76cbc4f218e6e8c02703da2132934cc
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2bc81c53a76cbc4f218e6e8c02703da2132934cc
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri May 31 13:11:33 2019 +0300
mf: Forward GetCorrelatedTime() to time source.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 be5ea64..8e41942 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 dc58dc1..8f9a97d 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);
More information about the wine-cvs
mailing list