Commit b3461c48 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf/session: Shutdown and release presentation clock on session shutdown.

parent b8e550a5
......@@ -1792,6 +1792,9 @@ static HRESULT WINAPI mfsession_Shutdown(IMFMediaSession *iface)
IMFMediaEventQueue_Shutdown(session->event_queue);
if (session->quality_manager)
IMFQualityManager_Shutdown(session->quality_manager);
MFShutdownObject((IUnknown *)session->clock);
IMFPresentationClock_Release(session->clock);
session->clock = NULL;
}
LeaveCriticalSection(&session->cs);
......
......@@ -1188,13 +1188,14 @@ static void test_media_session(void)
IMFAttributes *attributes;
IMFMediaSession *session;
IMFTopology *topology;
IMFShutdown *shutdown;
PROPVARIANT propvar;
DWORD status, caps;
IMFGetService *gs;
IMFClock *clock;
IUnknown *unk;
HRESULT hr;
float rate;
DWORD caps;
BOOL thin;
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL);
......@@ -1275,9 +1276,24 @@ todo_wine
hr = MFCreateMediaSession(NULL, &session);
ok(hr == S_OK, "Failed to create media session, hr %#x.\n", hr);
hr = IMFMediaSession_GetClock(session, &clock);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFClock_QueryInterface(clock, &IID_IMFShutdown, (void **)&shutdown);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFShutdown_GetShutdownStatus(shutdown, &status);
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
hr = IMFMediaSession_Shutdown(session);
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
hr = IMFShutdown_GetShutdownStatus(shutdown, &status);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(status == MFSHUTDOWN_COMPLETED, "Unexpected shutdown status %u.\n", status);
IMFShutdown_Release(shutdown);
hr = IMFMediaSession_ClearTopologies(session);
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
......
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