[vlc-devel] [PATCH 12/14] directx_va: do not load the DLL if it's already loaded
Steve Lhomme
robux4 at videolabs.io
Sat Nov 18 14:29:26 CET 2017
For D3D11 we always load it.
---
modules/codec/avcodec/d3d11va.c | 7 +------
modules/codec/avcodec/directx_va.c | 4 ++--
modules/codec/avcodec/directx_va.h | 2 +-
modules/codec/avcodec/dxva2.c | 2 +-
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 95542f9363..fe6c8de30f 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -337,7 +337,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
dx_sys->va_pool.pf_new_surface_context = NewSurfacePicContext;
dx_sys->pf_get_input_list = DxGetInputList;
dx_sys->pf_setup_output = DxSetupOutput;
- dx_sys->psz_decoder_dll = TEXT("D3D11.DLL");
va->sys = sys;
@@ -381,11 +380,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (err != VLC_SUCCESS)
goto error;
-#if VLC_WINSTORE_APP
- err = directx_va_Open(va, &sys->dx_sys, false);
-#else
- err = directx_va_Open(va, &sys->dx_sys, true);
-#endif
+ err = directx_va_Open(va, &sys->dx_sys);
if (err!=VLC_SUCCESS)
goto error;
diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index 4962aa7b5e..0c96876e5e 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -335,9 +335,9 @@ void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys)
FreeLibrary(dx_sys->hdecoder_dll);
}
-int directx_va_Open(vlc_va_t *va, directx_sys_t *dx_sys, bool b_dll)
+int directx_va_Open(vlc_va_t *va, directx_sys_t *dx_sys)
{
- if (b_dll) {
+ if (dx_sys->psz_decoder_dll) {
/* Load dll*/
dx_sys->hdecoder_dll = LoadLibrary(dx_sys->psz_decoder_dll);
if (!dx_sys->hdecoder_dll) {
diff --git a/modules/codec/avcodec/directx_va.h b/modules/codec/avcodec/directx_va.h
index df745298f3..19f31ca938 100644
--- a/modules/codec/avcodec/directx_va.h
+++ b/modules/codec/avcodec/directx_va.h
@@ -85,7 +85,7 @@ typedef struct
} directx_sys_t;
-int directx_va_Open(vlc_va_t *, directx_sys_t *, bool b_dll);
+int directx_va_Open(vlc_va_t *, directx_sys_t *);
void directx_va_Close(vlc_va_t *, directx_sys_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *);
char *directx_va_GetDecoderName(const GUID *guid);
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 2758cbea7e..9bdd4ac47d 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -296,7 +296,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
sys->d3d_dev.owner = false;
}
- err = directx_va_Open(va, &sys->dx_sys, true);
+ err = directx_va_Open(va, &sys->dx_sys);
if (err!=VLC_SUCCESS)
goto error;
--
2.14.2
More information about the vlc-devel
mailing list