[vlc-devel] [PATCH] DXVA2: we don't need to keep the D3DPRESENT_PARAMETERS

Steve Lhomme robUx4 at videolabs.io
Tue Apr 28 10:35:24 CEST 2015


---
 modules/codec/avcodec/dxva2.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 81c2a9c..482810c 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -328,7 +328,6 @@ struct vlc_va_sys_t
     HINSTANCE             hdxva2_dll;
 
     /* Direct3D */
-    D3DPRESENT_PARAMETERS  d3dpp;
     LPDIRECT3D9            d3dobj;
     D3DADAPTER_IDENTIFIER9 d3dai;
     LPDIRECT3DDEVICE9      d3ddev;
@@ -676,19 +675,19 @@ static int D3dCreateDevice(vlc_va_t *va)
     }
 
     /* */
-    D3DPRESENT_PARAMETERS *d3dpp = &sys->d3dpp;
-    ZeroMemory(d3dpp, sizeof(*d3dpp));
-    d3dpp->Flags                  = D3DPRESENTFLAG_VIDEO;
-    d3dpp->Windowed               = TRUE;
-    d3dpp->hDeviceWindow          = NULL;
-    d3dpp->SwapEffect             = D3DSWAPEFFECT_DISCARD;
-    d3dpp->MultiSampleType        = D3DMULTISAMPLE_NONE;
-    d3dpp->PresentationInterval   = D3DPRESENT_INTERVAL_DEFAULT;
-    d3dpp->BackBufferCount        = 0;                  /* FIXME what to put here */
-    d3dpp->BackBufferFormat       = D3DFMT_X8R8G8B8;    /* FIXME what to put here */
-    d3dpp->BackBufferWidth        = 0;
-    d3dpp->BackBufferHeight       = 0;
-    d3dpp->EnableAutoDepthStencil = FALSE;
+    D3DPRESENT_PARAMETERS d3dpp;
+    ZeroMemory(&d3dpp, sizeof(d3dpp));
+    d3dpp.Flags                  = D3DPRESENTFLAG_VIDEO;
+    d3dpp.Windowed               = TRUE;
+    d3dpp.hDeviceWindow          = NULL;
+    d3dpp.SwapEffect             = D3DSWAPEFFECT_DISCARD;
+    d3dpp.MultiSampleType        = D3DMULTISAMPLE_NONE;
+    d3dpp.PresentationInterval   = D3DPRESENT_INTERVAL_DEFAULT;
+    d3dpp.BackBufferCount        = 0;                  /* FIXME what to put here */
+    d3dpp.BackBufferFormat       = D3DFMT_X8R8G8B8;    /* FIXME what to put here */
+    d3dpp.BackBufferWidth        = 0;
+    d3dpp.BackBufferHeight       = 0;
+    d3dpp.EnableAutoDepthStencil = FALSE;
 
     /* Direct3D needs a HWND to create a device, even without using ::Present
     this HWND is used to alert Direct3D when there's a change of focus window.
@@ -698,7 +697,7 @@ static int D3dCreateDevice(vlc_va_t *va)
                                        D3DDEVTYPE_HAL, GetDesktopWindow(),
                                        D3DCREATE_SOFTWARE_VERTEXPROCESSING |
                                        D3DCREATE_MULTITHREADED,
-                                       d3dpp, &d3ddev))) {
+                                       &d3dpp, &d3ddev))) {
         msg_Err(va, "IDirect3D9_CreateDevice failed");
         return VLC_EGENERIC;
     }
-- 
2.3.2




More information about the vlc-devel mailing list