diff options
Diffstat (limited to 'video/out/d3d11/hwdec_dxva2dxgi.c')
-rw-r--r-- | video/out/d3d11/hwdec_dxva2dxgi.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/video/out/d3d11/hwdec_dxva2dxgi.c b/video/out/d3d11/hwdec_dxva2dxgi.c index 8dbb1cf65d..62158d467b 100644 --- a/video/out/d3d11/hwdec_dxva2dxgi.c +++ b/video/out/d3d11/hwdec_dxva2dxgi.c @@ -74,9 +74,9 @@ static int init(struct ra_hwdec *hw) int ret = -1; HRESULT hr; - if (!ra_is_d3d11(hw->ra)) + if (!ra_is_d3d11(hw->ra_ctx->ra)) goto done; - p->dev11 = ra_d3d11_get_device(hw->ra); + p->dev11 = ra_d3d11_get_device(hw->ra_ctx->ra); if (!p->dev11) goto done; @@ -134,7 +134,14 @@ static int init(struct ra_hwdec *hw) p->hwctx = (struct mp_hwdec_ctx){ .driver_name = hw->driver->name, .av_device_ref = d3d9_wrap_device_ref((IDirect3DDevice9 *)p->dev9), + .hw_imgfmt = IMGFMT_DXVA2, }; + + if (!p->hwctx.av_device_ref) { + MP_VERBOSE(hw, "Failed to create hwdevice_ctx\n"); + goto done; + } + hwdec_devices_add(hw->devs, &p->hwctx); ret = 0; |