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: default 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,
}
}
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)
goto error;
......
......@@ -422,13 +422,14 @@ 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,
AVCodecContext *ctx, const es_format_t *fmt)
AVCodecContext *ctx, const es_format_t *fmt, bool b_dll)
{
// TODO va->sys = sys;
dx_sys->codec_id = ctx->codec_id;
vlc_mutex_init( &dx_sys->surface_lock );
if (b_dll) {
/* Load dll*/
dx_sys->hdecoder_dll = LoadLibrary(dx_sys->psz_decoder_dll);
if (!dx_sys->hdecoder_dll) {
......@@ -436,6 +437,7 @@ int directx_va_Open(vlc_va_t *va, directx_sys_t *dx_sys,
goto error;
}
msg_Dbg(va, "DLLs loaded");
}
/* */
if (dx_sys->pf_create_device(va)) {
......
......@@ -134,7 +134,7 @@ typedef struct
} 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 *);
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);
......
......@@ -357,7 +357,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
if (p_sys!=NULL)
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)
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