mfmediaengine: Send "pause" event on Pause().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
41af1d1e71
commit
58f4680380
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue