mf: Partially implement Shutdown() for media session.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-05-31 13:11:28 +03:00 committed by Alexandre Julliard
parent 05d76e7cfe
commit 33a4151bbe
2 changed files with 12 additions and 3 deletions

View File

@ -62,6 +62,7 @@ struct media_session
IMFMediaEventQueue *event_queue;
IMFPresentationClock *clock;
struct list topologies;
BOOL is_shut_down;
CRITICAL_SECTION cs;
};
@ -412,12 +413,21 @@ static HRESULT WINAPI mfsession_Close(IMFMediaSession *iface)
static HRESULT WINAPI mfsession_Shutdown(IMFMediaSession *iface)
{
struct media_session *session = impl_from_IMFMediaSession(iface);
HRESULT hr = S_OK;
FIXME("(%p)\n", iface);
IMFMediaEventQueue_Shutdown(session->event_queue);
EnterCriticalSection(&session->cs);
if (session->is_shut_down)
hr = MF_E_SHUTDOWN;
else
{
session->is_shut_down = TRUE;
IMFMediaEventQueue_Shutdown(session->event_queue);
}
LeaveCriticalSection(&session->cs);
return E_NOTIMPL;
return hr;
}
static HRESULT WINAPI mfsession_GetClock(IMFMediaSession *iface, IMFClock **clock)

View File

@ -944,7 +944,6 @@ static void test_session_events(IMFMediaSession *session)
/* Shutdown behavior. */
hr = IMFMediaSession_Shutdown(session);
todo_wine
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
}