From 0dbbe8da25be1b828aa4babb89fc45a9de1aa9de Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 19 Apr 2021 16:02:01 +0300 Subject: [PATCH] mf/evr: Set initial output window size for the presenter. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/mf/Makefile.in | 2 +- dlls/mf/evr.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/mf/Makefile.in b/dlls/mf/Makefile.in index f60e337b386..e56d4c04a84 100644 --- a/dlls/mf/Makefile.in +++ b/dlls/mf/Makefile.in @@ -1,7 +1,7 @@ MODULE = mf.dll IMPORTLIB = mf IMPORTS = advapi32 mfplat ole32 uuid mfuuid strmiids -DELAYIMPORTS = evr +DELAYIMPORTS = evr user32 EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c index 9cb6763da4e..79e2f57f9c5 100644 --- a/dlls/mf/evr.c +++ b/dlls/mf/evr.c @@ -1611,11 +1611,15 @@ static HRESULT video_renderer_configure_mixer(struct video_renderer *renderer) static HRESULT video_renderer_configure_presenter(struct video_renderer *renderer) { IMFVideoDisplayControl *control; + RECT rect = { 0 }; HRESULT hr; if (SUCCEEDED(IMFVideoPresenter_QueryInterface(renderer->presenter, &IID_IMFVideoDisplayControl, (void **)&control))) { - IMFVideoDisplayControl_SetVideoWindow(control, renderer->window); + GetClientRect(renderer->window, &rect); + + if (SUCCEEDED(hr = IMFVideoDisplayControl_SetVideoWindow(control, renderer->window))) + hr = IMFVideoDisplayControl_SetVideoPosition(control, NULL, &rect); IMFVideoDisplayControl_Release(control); }