[vlc-commits] vout:win32: place the picture in the display area early

Steve Lhomme git at videolan.org
Tue May 7 12:01:10 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Apr 24 08:24:46 2019 +0200| [4ff074ef7260c2ecf6db30374aa6a574a0c1c9d6] | committer: Steve Lhomme

vout:win32: place the picture in the display area early

This way we don't need a forced call during each init.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ff074ef7260c2ecf6db30374aa6a574a0c1c9d6
---

 modules/video_output/win32/common.c     | 2 ++
 modules/video_output/win32/direct3d11.c | 6 ++++--
 modules/video_output/win32/direct3d9.c  | 6 ++++--
 modules/video_output/win32/wingdi.c     | 2 --
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/common.c b/modules/video_output/win32/common.c
index 0d22bca706..01e19c07e1 100644
--- a/modules/video_output/win32/common.c
+++ b/modules/video_output/win32/common.c
@@ -90,6 +90,8 @@ int CommonWindowInit(vlc_object_t *obj, display_win32_area_t *area,
     sys->hparent       = hwnd.hparent;
     sys->hvideownd     = hwnd.hvideownd;
 
+    CommonPlacePicture(obj, area, sys);
+
     return VLC_SUCCESS;
 }
 #endif /* !VLC_WINSTORE_APP */
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 8baf91a68a..3634fde2e5 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -472,6 +472,10 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         sys->internal_swapchain.swapchainHwnd = sys->sys.hvideownd;
 #endif /* !VLC_WINSTORE_APP */
     }
+    else
+    {
+        CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
+    }
 
     if (vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR && sys->sys.hvideownd)
         sys->p_sensors = HookWindowsSensors(vd, sys->sys.hvideownd);
@@ -1561,8 +1565,6 @@ static int Direct3D11CreateGenericResources(vout_display_t *vd)
         ID3D11DepthStencilState_Release(pDepthStencilState);
     }
 
-    CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
-
     hr = UpdateBackBuffer(vd);
     if (FAILED(hr)) {
        msg_Err(vd, "Could not update the backbuffer. (hr=0x%lX)", hr);
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index ead7dd5970..bfa67e8cf4 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1494,8 +1494,6 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt,
     fmt->i_bmask  = d3dfmt->bmask;
     sys->sw_texture_fmt = d3dfmt;
 
-    CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
-
     if (Direct3D9CreateResources(vd, fmt)) {
         msg_Err(vd, "Failed to allocate resources");
         goto error;
@@ -1654,6 +1652,10 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         if (CommonWindowInit(VLC_OBJECT(vd), &sys->area, &sys->sys, false))
             goto error;
     }
+    else
+    {
+        CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
+    }
 
     /* */
     video_format_t fmt;
diff --git a/modules/video_output/win32/wingdi.c b/modules/video_output/win32/wingdi.c
index 28da26a4a0..2e7054b318 100644
--- a/modules/video_output/win32/wingdi.c
+++ b/modules/video_output/win32/wingdi.c
@@ -274,8 +274,6 @@ static int Init(vout_display_t *vd, video_format_t *fmt)
 
     vout_window_SetTitle(sys->area.vdcfg.window, VOUT_TITLE " (WinGDI output)");
 
-    CommonPlacePicture(VLC_OBJECT(vd), &sys->area, &sys->sys);
-
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list