Commit 58f46803 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfmediaengine: Send "pause" event on Pause().

parent 41af1d1e
......@@ -476,9 +476,26 @@ static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface)
static HRESULT WINAPI media_engine_Pause(IMFMediaEngine *iface)
{
FIXME("(%p): stub.\n", iface);
struct media_engine *engine = impl_from_IMFMediaEngine(iface);
return E_NOTIMPL;
TRACE("%p.\n", iface);
EnterCriticalSection(&engine->cs);
if (!(engine->flags & FLAGS_ENGINE_PAUSED))
{
engine->flags &= ~FLAGS_ENGINE_WAITING;
engine->flags |= FLAGS_ENGINE_PAUSED;
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_TIMEUPDATE, 0, 0);
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PAUSE, 0, 0);
}
IMFMediaEngineNotify_EventNotify(engine->callback, MF_MEDIA_ENGINE_EVENT_PURGEQUEUEDEVENTS, 0, 0);
LeaveCriticalSection(&engine->cs);
return S_OK;
}
static BOOL WINAPI media_engine_GetMuted(IMFMediaEngine *iface)
......
......@@ -421,6 +421,23 @@ static void test_Play(void)
ok(!ret, "Unexpected state %d.\n", ret);
IMFMediaEngine_Release(media_engine);
/* Play -> Pause */
media_engine = create_media_engine(callback);
hr = IMFMediaEngine_Play(media_engine);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ret = IMFMediaEngine_IsPaused(media_engine);
ok(!ret, "Unexpected state %d.\n", ret);
hr = IMFMediaEngine_Pause(media_engine);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ret = IMFMediaEngine_IsPaused(media_engine);
ok(!!ret, "Unexpected state %d.\n", ret);
IMFMediaEngine_Release(media_engine);
}
START_TEST(mfmediaengine)
......
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