summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/d3d11_helpers.c
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2019-10-14 20:30:09 +0300
committerJan Ekström <jeebjp@gmail.com>2019-10-15 22:12:48 +0300
commit89f4ce9d6f31d817eb68dede9b066b0af1416fc2 (patch)
tree57c97fab65d176b98e4b6ce3962e041308090238 /video/out/gpu/d3d11_helpers.c
parent684ffd13b4940eb7a5d4228f850d903a72570242 (diff)
downloadmpv-89f4ce9d6f31d817eb68dede9b066b0af1416fc2.tar.bz2
mpv-89f4ce9d6f31d817eb68dede9b066b0af1416fc2.tar.xz
vo_gpu/d3d11: switch adapter selection to case-insensitive startswith
This lets users set values such as "intel" or "nvidia" as the adapter vendor is generally noted in the beginning of the description string.
Diffstat (limited to 'video/out/gpu/d3d11_helpers.c')
-rw-r--r--video/out/gpu/d3d11_helpers.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/video/out/gpu/d3d11_helpers.c b/video/out/gpu/d3d11_helpers.c
index 6ea778a875..73d2c667a8 100644
--- a/video/out/gpu/d3d11_helpers.c
+++ b/video/out/gpu/d3d11_helpers.c
@@ -204,8 +204,9 @@ static IDXGIAdapter1 *get_d3d11_adapter(struct mp_log *log,
adapter_description ? adapter_description : "<No Description>");
}
- if (adapter_description &&
- bstr_equals0(requested_adapter_name, adapter_description))
+ if (adapter_description && requested_adapter_name.len &&
+ bstr_case_startswith(bstr0(adapter_description),
+ requested_adapter_name))
{
picked_adapter = adapter;
break;
@@ -282,7 +283,7 @@ bool mp_d3d11_create_present_device(struct mp_log *log,
adapter = get_d3d11_adapter(log, bstr0(adapter_name), NULL);
if (adapter_name && !adapter) {
- mp_warn(log, "Adapter '%s' was not found in the system! "
+ mp_warn(log, "Adapter matching '%s' was not found in the system! "
"Will fall back to the default adapter.\n",
adapter_name);
}