[vlc-commits] directx_va: Fix fallback from d3d11va to d3d9va/dxva2 after the recent refactorings
Martin Storsjö
git at videolan.org
Tue Sep 10 11:04:42 CEST 2019
vlc | branch: master | Martin Storsjö <martin at martin.st> | Tue Sep 10 12:00:31 2019 +0300| [b8e08bd8325881407171e1147cd90fbf42d5f106] | committer: Martin Storsjö
directx_va: Fix fallback from d3d11va to d3d9va/dxva2 after the recent refactorings
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b8e08bd8325881407171e1147cd90fbf42d5f106
---
modules/codec/avcodec/d3d11va.c | 6 ++++--
modules/codec/avcodec/va_surface.c | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 0bd3bdddae..d6477cfaca 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -476,8 +476,10 @@ static int D3dCreateDevice(vlc_va_t *va)
static void D3dDestroyDevice(vlc_va_t *va)
{
vlc_va_sys_t *sys = va->sys;
- ID3D11VideoDevice_Release(sys->d3ddec);
- ID3D11VideoContext_Release(sys->hw.video_context);
+ if (sys->d3ddec)
+ ID3D11VideoDevice_Release(sys->d3ddec);
+ if (sys->hw.video_context)
+ ID3D11VideoContext_Release(sys->hw.video_context);
D3D11_ReleaseDevice( &sys->d3d_dev );
}
diff --git a/modules/codec/avcodec/va_surface.c b/modules/codec/avcodec/va_surface.c
index 78a5c547a1..a895a9b33a 100644
--- a/modules/codec/avcodec/va_surface.c
+++ b/modules/codec/avcodec/va_surface.c
@@ -176,6 +176,8 @@ void va_pool_Close(vlc_va_t *va, va_pool_t *va_pool)
int va_pool_Open(vlc_va_t *va, const struct va_pool_cfg *cbs, va_pool_t *va_pool)
{
+ va_pool->callbacks = cbs;
+
/* */
if (cbs->pf_create_device(va)) {
msg_Err(va, "Failed to create device");
@@ -183,8 +185,6 @@ int va_pool_Open(vlc_va_t *va, const struct va_pool_cfg *cbs, va_pool_t *va_pool
}
msg_Dbg(va, "CreateDevice succeed");
- va_pool->callbacks = cbs;
-
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list