mfmediaengine: Force returned playback position after presentation ends.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-01-29 15:10:00 +03:00 committed by Alexandre Julliard
parent 67815c2f62
commit 3556990387
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}