Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfmediaengine/main.c | 20 +++++++++++++++++--- dlls/mfmediaengine/tests/mfmediaengine.c | 3 --- 2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index 7053a3afea3..eef485e315b 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -60,6 +60,7 @@ enum media_engine_flags /* MF_MEDIA_ENGINE_CREATEFLAGS_MASK is 0x1f. */ FLAGS_ENGINE_SHUT_DOWN = 0x20, FLAGS_ENGINE_AUTO_PLAY = 0x40, + FLAGS_ENGINE_LOOP = 0x80, };
struct media_engine @@ -342,16 +343,29 @@ static HRESULT WINAPI media_engine_SetAutoPlay(IMFMediaEngine *iface, BOOL autop
static BOOL WINAPI media_engine_GetLoop(IMFMediaEngine *iface) { - FIXME("(%p): stub.\n", iface); + struct media_engine *engine = impl_from_IMFMediaEngine(iface); + BOOL value;
- return FALSE; + TRACE("%p.\n", iface); + + EnterCriticalSection(&engine->cs); + value = !!(engine->flags & FLAGS_ENGINE_LOOP); + LeaveCriticalSection(&engine->cs); + + return value; }
static HRESULT WINAPI media_engine_SetLoop(IMFMediaEngine *iface, BOOL loop) { + struct media_engine *engine = impl_from_IMFMediaEngine(iface); + FIXME("(%p, %d): stub.\n", iface, loop);
- return E_NOTIMPL; + EnterCriticalSection(&engine->cs); + media_engine_set_flag(engine, FLAGS_ENGINE_LOOP, loop); + LeaveCriticalSection(&engine->cs); + + return S_OK; }
static HRESULT WINAPI media_engine_Play(IMFMediaEngine *iface) diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c index 8f6c4ca75bb..504464b5272 100644 --- a/dlls/mfmediaengine/tests/mfmediaengine.c +++ b/dlls/mfmediaengine/tests/mfmediaengine.c @@ -341,7 +341,6 @@ todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
state = IMFMediaEngine_GetAutoPlay(media_engine); -todo_wine ok(!!state, "Unexpected state.\n");
/* Loop mode is still accessible. */ @@ -349,11 +348,9 @@ todo_wine ok(!state, "Unexpected state.\n");
hr = IMFMediaEngine_SetLoop(media_engine, TRUE); -todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
state = IMFMediaEngine_GetLoop(media_engine); -todo_wine ok(!!state, "Unexpected state.\n");
hr = IMFMediaEngine_Play(media_engine);