[PATCH] mf/evr: Set initial output window size for the presenter.

Nikolay Sivov nsivov at codeweavers.com
Mon Apr 19 08:02:01 CDT 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 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);
     }
 
-- 
2.30.2




More information about the wine-devel mailing list