Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/evr.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index cc3f828e540..7a00c4dd038 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -539,7 +539,11 @@ static HRESULT WINAPI video_stream_get_service_GetService(IMFGetService *iface, EnterCriticalSection(&stream->cs);
if (!stream->allocator) + { hr = MFCreateVideoSampleAllocator(&IID_IMFVideoSampleAllocator, (void **)&stream->allocator); + if (SUCCEEDED(hr)) + hr = IMFVideoSampleAllocator_SetDirectXManager(stream->allocator, stream->parent->device_manager); + } if (SUCCEEDED(hr)) hr = IMFVideoSampleAllocator_QueryInterface(stream->allocator, riid, obj);
@@ -667,6 +671,8 @@ static ULONG WINAPI video_renderer_sink_Release(IMFMediaSink *iface) IMFTransform_Release(renderer->mixer); if (renderer->presenter) IMFVideoPresenter_Release(renderer->presenter); + if (renderer->device_manager) + IUnknown_Release(renderer->device_manager); if (renderer->clock) IMFPresentationClock_Release(renderer->clock); if (renderer->attributes) @@ -1183,6 +1189,12 @@ static HRESULT video_renderer_configure_presenter(struct video_renderer *rendere IMFTopologyServiceLookupClient_Release(lookup_client); }
+ if (FAILED(MFGetService((IUnknown *)renderer->presenter, &MR_VIDEO_ACCELERATION_SERVICE, + &IID_IUnknown, (void **)&renderer->device_manager))) + { + WARN("Failed to get device manager from the presenter.\n"); + } + return hr; }
@@ -1203,6 +1215,12 @@ static HRESULT video_renderer_initialize(struct video_renderer *renderer, IMFTra renderer->presenter = NULL; }
+ if (renderer->device_manager) + { + IUnknown_Release(renderer->device_manager); + renderer->device_manager = NULL; + } + renderer->mixer = mixer; IMFTransform_AddRef(renderer->mixer);