summaryrefslogtreecommitdiffstats
path: root/video/decode/hw_d3d11va.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-30 12:46:12 +0200
committerwm4 <wm4@nowhere>2017-06-30 18:57:37 +0200
commitf003d8ea367f247e3ff49b672003817a0c3cdb30 (patch)
treeff198c9ec228a30d226edadfd741956a9a24af70 /video/decode/hw_d3d11va.c
parentdd408e68ed57fa5130bef976751e58a5d6e42f75 (diff)
downloadmpv-f003d8ea367f247e3ff49b672003817a0c3cdb30.tar.bz2
mpv-f003d8ea367f247e3ff49b672003817a0c3cdb30.tar.xz
d3d: UWP support for D3D11VA
For some braindead reason, Microsoft decided to prevent you from dynamically loading system libraries. This makes portability harder. And we're talking about portability between Microsoft OSes!
Diffstat (limited to 'video/decode/hw_d3d11va.c')
-rw-r--r--video/decode/hw_d3d11va.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/video/decode/hw_d3d11va.c b/video/decode/hw_d3d11va.c
index c8255a36db..b75960945d 100644
--- a/video/decode/hw_d3d11va.c
+++ b/video/decode/hw_d3d11va.c
@@ -607,22 +607,14 @@ static struct mp_hwdec_ctx *d3d11_create_dev(struct mpv_global *global,
HRESULT hr;
d3d_load_dlls();
- if (!d3d11_dll) {
+ if (!d3d11_D3D11CreateDevice) {
mp_err(plog, "Failed to load D3D11 library\n");
return NULL;
}
- PFN_D3D11_CREATE_DEVICE CreateDevice =
- (void *)GetProcAddress(d3d11_dll, "D3D11CreateDevice");
- if (!CreateDevice) {
- mp_err(plog, "Failed to get D3D11CreateDevice symbol from DLL: %s\n",
- mp_LastError_to_str());
- return NULL;
- }
-
- hr = CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL,
- D3D11_CREATE_DEVICE_VIDEO_SUPPORT, NULL, 0,
- D3D11_SDK_VERSION, &device, NULL, NULL);
+ hr = d3d11_D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL,
+ D3D11_CREATE_DEVICE_VIDEO_SUPPORT, NULL, 0,
+ D3D11_SDK_VERSION, &device, NULL, NULL);
if (FAILED(hr)) {
mp_err(plog, "Failed to create D3D11 Device: %s\n",
mp_HRESULT_to_str(hr));