mfmediaengine: Handle shutdown state in Play().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
86c0afc797
commit
0f4f7ca937
|
@ -1784,11 +1784,16 @@ static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngineEx *iface, BOOL loop)
|
|||
static HRESULT WINAPI media_engine_Play(IMFMediaEngineEx *iface)
|
||||
{
|
||||
struct media_engine *engine = impl_from_IMFMediaEngineEx(iface);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
TRACE("%p.\n", iface);
|
||||
|
||||
EnterCriticalSection(&engine->cs);
|
||||
|
||||
if (engine->flags & FLAGS_ENGINE_SHUT_DOWN)
|
||||
hr = MF_E_SHUTDOWN;
|
||||
else
|
||||
{
|
||||
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS, 0, 0);
|
||||
|
||||
if (!(engine->flags & FLAGS_ENGINE_WAITING))
|
||||
|
@ -1805,10 +1810,11 @@ static HRESULT WINAPI media_engine_Play(IMFMediaEngineEx *iface)
|
|||
}
|
||||
|
||||
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_WAITING, 0, 0);
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&engine->cs);
|
||||
|
||||
return S_OK;
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI media_engine_Pause(IMFMediaEngineEx *iface)
|
||||
|
|
|
@ -414,7 +414,6 @@ todo_wine
|
|||
ok(!!state, "Unexpected state.\n");
|
||||
|
||||
hr = IMFMediaEngine_Play(media_engine);
|
||||
todo_wine
|
||||
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
|
||||
|
||||
hr = IMFMediaEngine_Pause(media_engine);
|
||||
|
|
Loading…
Reference in New Issue