Commit 84b66e15 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfmediaengine: Return full presentation range in GetBuffered().

parent db549a68
......@@ -1152,11 +1152,22 @@ static HRESULT WINAPI media_engine_SetPreload(IMFMediaEngine *iface, MF_MEDIA_EN
return S_OK;
}
static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTimeRange **buffered)
static HRESULT WINAPI media_engine_GetBuffered(IMFMediaEngine *iface, IMFMediaTimeRange **range)
{
FIXME("(%p, %p): stub.\n", iface, buffered);
struct media_engine *engine = impl_from_IMFMediaEngine(iface);
HRESULT hr;
return E_NOTIMPL;
TRACE("%p, %p.\n", iface, range);
if (FAILED(hr = create_time_range(range)))
return hr;
EnterCriticalSection(&engine->cs);
if (!isnan(engine->duration))
hr = IMFMediaTimeRange_AddRange(*range, 0.0, engine->duration);
LeaveCriticalSection(&engine->cs);
return hr;
}
static HRESULT WINAPI media_engine_Load(IMFMediaEngine *iface)
......
......@@ -391,13 +391,27 @@ static void test_Play(void)
{
struct media_engine_notify notify_impl = {{&media_engine_notify_vtbl}, 1};
IMFMediaEngineNotify *callback = &notify_impl.IMFMediaEngineNotify_iface;
IMFMediaTimeRange *range, *range1;
IMFMediaEngine *media_engine;
LONGLONG pts;
DWORD count;
HRESULT hr;
BOOL ret;
media_engine = create_media_engine(callback);
hr = IMFMediaEngine_GetBuffered(media_engine, &range);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFMediaEngine_GetBuffered(media_engine, &range1);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(range != range1, "Unexpected pointer.\n");
count = IMFMediaTimeRange_GetLength(range);
ok(!count, "Unexpected count %u.\n", count);
IMFMediaTimeRange_Release(range);
IMFMediaTimeRange_Release(range1);
ret = IMFMediaEngine_IsPaused(media_engine);
ok(ret, "Unexpected state %d.\n", ret);
......
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