Commit b8d10aa4 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf/evr: Create sample allocators on demand.

parent a6512b32
......@@ -528,13 +528,26 @@ static ULONG WINAPI video_stream_get_service_Release(IMFGetService *iface)
static HRESULT WINAPI video_stream_get_service_GetService(IMFGetService *iface, REFGUID service, REFIID riid, void **obj)
{
struct video_stream *stream = impl_from_stream_IMFGetService(iface);
HRESULT hr = S_OK;
TRACE("%p, %s, %s, %p.\n", iface, debugstr_guid(service), debugstr_guid(riid), obj);
if (IsEqualGUID(service, &MR_VIDEO_ACCELERATION_SERVICE))
{
if (IsEqualIID(riid, &IID_IMFVideoSampleAllocator))
return IMFVideoSampleAllocator_QueryInterface(stream->allocator, riid, obj);
{
EnterCriticalSection(&stream->cs);
if (!stream->allocator)
hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocator, (void **)&stream->allocator);
if (SUCCEEDED(hr))
hr = IMFVideoSampleAllocator_QueryInterface(stream->allocator, riid, obj);
LeaveCriticalSection(&stream->cs);
return hr;
}
return E_NOINTERFACE;
}
......@@ -569,9 +582,6 @@ static HRESULT video_renderer_stream_create(struct video_renderer *renderer, uns
if (FAILED(hr = MFCreateEventQueue(&stream->event_queue)))
goto failed;
if (FAILED(hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocator, (void **)&stream->allocator)))
goto failed;
stream->parent = renderer;
IMFMediaSink_AddRef(&stream->parent->IMFMediaSink_iface);
stream->id = id;
......
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