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

directx-va: do not load the DLL if not needed

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent a86871ff
...@@ -348,7 +348,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -348,7 +348,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
} }
} }
err = directx_va_Open(va, &sys->dx_sys, ctx, fmt); err = directx_va_Open(va, &sys->dx_sys, ctx, fmt, dx_sys->d3ddev==NULL || va->sys->d3dctx==NULL);
if (err!=VLC_SUCCESS) if (err!=VLC_SUCCESS)
goto error; goto error;
......
...@@ -422,20 +422,22 @@ void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys) ...@@ -422,20 +422,22 @@ void directx_va_Close(vlc_va_t *va, directx_sys_t *dx_sys)
} }
int directx_va_Open(vlc_va_t *va, directx_sys_t *dx_sys, int directx_va_Open(vlc_va_t *va, directx_sys_t *dx_sys,
AVCodecContext *ctx, const es_format_t *fmt) AVCodecContext *ctx, const es_format_t *fmt, bool b_dll)
{ {
// TODO va->sys = sys; // TODO va->sys = sys;
dx_sys->codec_id = ctx->codec_id; dx_sys->codec_id = ctx->codec_id;
vlc_mutex_init( &dx_sys->surface_lock ); vlc_mutex_init( &dx_sys->surface_lock );
/* Load dll*/ if (b_dll) {
dx_sys->hdecoder_dll = LoadLibrary(dx_sys->psz_decoder_dll); /* Load dll*/
if (!dx_sys->hdecoder_dll) { dx_sys->hdecoder_dll = LoadLibrary(dx_sys->psz_decoder_dll);
msg_Warn(va, "cannot load DirectX decoder DLL"); if (!dx_sys->hdecoder_dll) {
goto error; msg_Warn(va, "cannot load DirectX decoder DLL");
goto error;
}
msg_Dbg(va, "DLLs loaded");
} }
msg_Dbg(va, "DLLs loaded");
/* */ /* */
if (dx_sys->pf_create_device(va)) { if (dx_sys->pf_create_device(va)) {
......
...@@ -134,7 +134,7 @@ typedef struct ...@@ -134,7 +134,7 @@ typedef struct
} directx_sys_t; } directx_sys_t;
int directx_va_Open(vlc_va_t *, directx_sys_t *, AVCodecContext *ctx, const es_format_t *fmt); int directx_va_Open(vlc_va_t *, directx_sys_t *, AVCodecContext *ctx, const es_format_t *fmt, bool b_dll);
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 *, AVCodecContext *avctx, vlc_fourcc_t *chroma); int directx_va_Setup(vlc_va_t *, directx_sys_t *, AVCodecContext *avctx, vlc_fourcc_t *chroma);
int directx_va_Get(vlc_va_t *, directx_sys_t *, picture_t *pic, uint8_t **data); int directx_va_Get(vlc_va_t *, directx_sys_t *, picture_t *pic, uint8_t **data);
......
...@@ -357,7 +357,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt, ...@@ -357,7 +357,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (p_sys!=NULL) if (p_sys!=NULL)
IDirect3DSurface9_GetDevice(p_sys->surface, (IDirect3DDevice9**) &dx_sys->d3ddev ); IDirect3DSurface9_GetDevice(p_sys->surface, (IDirect3DDevice9**) &dx_sys->d3ddev );
err = directx_va_Open(va, &sys->dx_sys, ctx, fmt); err = directx_va_Open(va, &sys->dx_sys, ctx, fmt, dx_sys->d3ddev==NULL);
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