Commit 8245920d authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

directx_va: do not load the DLL if it's already loaded

For D3D11 we always load it.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent e3f5fb03
...@@ -354,7 +354,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -354,7 +354,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->va_pool.pf_new_surface_context = NewSurfacePicContext;
dx_sys->pf_get_input_list = DxGetInputList; dx_sys->pf_get_input_list = DxGetInputList;
dx_sys->pf_setup_output = DxSetupOutput; dx_sys->pf_setup_output = DxSetupOutput;
dx_sys->psz_decoder_dll = TEXT("D3D11.DLL");
va->sys = sys; va->sys = sys;
...@@ -398,11 +397,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -398,11 +397,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (err != VLC_SUCCESS) if (err != VLC_SUCCESS)
goto error; goto error;
#if VLC_WINSTORE_APP err = directx_va_Open(va, &sys->dx_sys);
err = directx_va_Open(va, &sys->dx_sys, false);
#else
err = directx_va_Open(va, &sys->dx_sys, true);
#endif
if (err!=VLC_SUCCESS) if (err!=VLC_SUCCESS)
goto error; goto error;
......
...@@ -335,9 +335,9 @@ void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys) ...@@ -335,9 +335,9 @@ void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys)
FreeLibrary(dx_sys->hdecoder_dll); 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*/ /* Load dll*/
dx_sys->hdecoder_dll = LoadLibrary(dx_sys->psz_decoder_dll); dx_sys->hdecoder_dll = LoadLibrary(dx_sys->psz_decoder_dll);
if (!dx_sys->hdecoder_dll) { if (!dx_sys->hdecoder_dll) {
......
...@@ -85,7 +85,7 @@ typedef struct ...@@ -85,7 +85,7 @@ typedef struct
} directx_sys_t; } 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 *); 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 *); int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *);
char *directx_va_GetDecoderName(const GUID *guid); char *directx_va_GetDecoderName(const GUID *guid);
......
...@@ -296,7 +296,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -296,7 +296,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
sys->d3d_dev.owner = false; 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) if (err!=VLC_SUCCESS)
goto error; goto error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment