aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Niklas Haas <git@haasn.xyz>2018-10-21 08:57:42 +0200
committerGravatar sfan5 <sfan5@live.de>2018-10-21 23:33:36 +0200
commitfacc63b862069eb24c14837a6762e5e681e52b7a (patch)
tree1d94d6d1af2e984cb5af87cb00baca6e7c8f4199
parent9a52b90f04597fb7ee3cbc806404ac0984ebd50d (diff)
vo_gpu: vulkan: suppress bogus error message on --vulkan-device
Since the code just broke out of the loop on a match rather than jumping straight to the end of the function body, it ended up hitting the code path for when the end of the list was reached.
-rw-r--r--video/out/vulkan/context.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c
index cbe0911385..6a029e10f8 100644
--- a/video/out/vulkan/context.c
+++ b/video/out/vulkan/context.c
@@ -54,16 +54,16 @@ static int vk_validate_dev(struct mp_log *log, const struct m_option *opt,
res = vkCreateInstance(&info, MPVK_ALLOCATOR, &inst);
if (res != VK_SUCCESS)
- goto error;
+ goto done;
res = vkEnumeratePhysicalDevices(inst, &num, NULL);
if (res != VK_SUCCESS)
- goto error;
+ goto done;
devices = talloc_array(NULL, VkPhysicalDevice, num);
vkEnumeratePhysicalDevices(inst, &num, devices);
if (res != VK_SUCCESS)
- goto error;
+ goto done;
bool help = bstr_equals0(param, "help");
if (help) {
@@ -80,14 +80,14 @@ static int vk_validate_dev(struct mp_log *log, const struct m_option *opt,
(unsigned)prop.vendorID, (unsigned)prop.deviceID);
} else if (bstr_equals0(param, prop.deviceName)) {
ret = 0;
- break;
+ goto done;
}
}
if (!help)
mp_err(log, "No device with name '%.*s'!\n", BSTR_P(param));
-error:
+done:
talloc_free(devices);
return ret;
}