[vlc-commits] direct3d11: simplify the use of internal callbacks

Steve Lhomme git at videolan.org
Fri May 10 09:07:12 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri May 10 08:20:53 2019 +0200| [c20b1e8d2531740e05d5d3e0d15bc5cbfcccf01b] | committer: Steve Lhomme

direct3d11: simplify the use of internal callbacks

No need for the local boolean

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

 modules/video_output/win32/direct3d11.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 9eeb24f6b0..8a2691e09b 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -635,9 +635,11 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     if (ret != VLC_SUCCESS)
         return ret;
 
-    bool uses_external_callbacks = true;
+    CommonInit(vd, &sys->area, cfg);
+
     if (sys->swapCb == NULL || sys->startEndRenderingCb == NULL || sys->updateOutputCb == NULL)
     {
+        /* use our internal swapchain callbacks */
         sys->internal_swapchain.obj = VLC_OBJECT(vd);
         sys->internal_swapchain.hd3d =  &sys->hd3d;
         sys->outside_opaque = &sys->internal_swapchain;
@@ -646,12 +648,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         sys->updateOutputCb      = LocalSwapchainUpdateOutput;
         sys->swapCb              = LocalSwapchainSwap;
         sys->startEndRenderingCb = LocalSwapchainStartEndRendering;
-        uses_external_callbacks = false;
-    }
 
-    CommonInit(vd, &sys->area, cfg);
-    if ( !uses_external_callbacks )
-    {
 #if VLC_WINSTORE_APP
         /* LEGACY, the d3dcontext and swapchain were given by the host app */
         if (var_InheritInteger(vd, "winrt-d3dcontext") == 0)



More information about the vlc-commits mailing list