From 35569903876e4893d3430d734442cba759d63f1d Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 29 Jan 2021 15:10:00 +0300 Subject: [PATCH] mfmediaengine: Force returned playback position after presentation ends. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mfmediaengine/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index 42aa8a6e92a..8c3b4f41229 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -1214,7 +1214,11 @@ static double WINAPI media_engine_GetCurrentTime(IMFMediaEngine *iface) TRACE("%p.\n", iface); EnterCriticalSection(&engine->cs); - if (SUCCEEDED(IMFPresentationClock_GetTime(engine->clock, &clocktime))) + if (engine->flags & FLAGS_ENGINE_IS_ENDED) + { + ret = engine->duration; + } + else if (SUCCEEDED(IMFPresentationClock_GetTime(engine->clock, &clocktime))) { ret = (double)clocktime / 10000000.0; }