[vlc-commits] opengl: dxva2: check we have a IDirect3DDevice9Ex earlier
Steve Lhomme
git at videolan.org
Tue Mar 17 07:49:02 CET 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Mar 16 13:20:23 2020 +0100| [15132bbffb0f89bfa9ef7dd79221235e501ee8e6] | committer: Steve Lhomme
opengl: dxva2: check we have a IDirect3DDevice9Ex earlier
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=15132bbffb0f89bfa9ef7dd79221235e501ee8e6
---
modules/video_output/opengl/interop_dxva2.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/video_output/opengl/interop_dxva2.c b/modules/video_output/opengl/interop_dxva2.c
index a25ba942e6..a8b37a0835 100644
--- a/modules/video_output/opengl/interop_dxva2.c
+++ b/modules/video_output/opengl/interop_dxva2.c
@@ -195,6 +195,12 @@ GLConvOpen(vlc_object_t *obj)
if ( vctx_sys == NULL || d3d9_decoder == NULL )
return VLC_EGENERIC;
+ if (!d3d9_decoder->hd3d.use_ex)
+ {
+ msg_Warn(obj, "DX/GL interrop only working on d3d9x");
+ return VLC_EGENERIC;
+ }
+
if (interop->gl->ext != VLC_GL_EXT_WGL || !interop->gl->wgl.getExtensionsString)
return VLC_EGENERIC;
@@ -226,12 +232,6 @@ GLConvOpen(vlc_object_t *obj)
interop->priv = priv;
priv->vt = vt;
- if (!d3d9_decoder->hd3d.use_ex)
- {
- msg_Warn(obj, "DX/GL interrop only working on d3d9x");
- goto error;
- }
-
HRESULT hr;
HANDLE shared_handle = NULL;
hr = IDirect3DDevice9Ex_CreateRenderTarget(d3d9_decoder->d3ddev.devex,
@@ -249,7 +249,7 @@ GLConvOpen(vlc_object_t *obj)
if (shared_handle)
priv->vt.DXSetResourceShareHandleNV(priv->dx_render, shared_handle);
- priv->gl_handle_d3d = priv->vt.DXOpenDeviceNV(d3d9_decoder->d3ddev.dev);
+ priv->gl_handle_d3d = priv->vt.DXOpenDeviceNV(d3d9_decoder->d3ddev.devex);
if (!priv->gl_handle_d3d)
{
msg_Warn(obj, "DXOpenDeviceNV failed: %lu", GetLastError());
More information about the vlc-commits
mailing list