hwdec_vulkan: respect probing flag when logging during init

All hwdecs should respect the probing flag and demote their lgoging to
verbose level, so that initialisation failures during probing do not
spam the user. I forgot to do this for the Vulkan hwdec.
This commit is contained in:
Philip Langdale 2023-06-03 18:35:49 -07:00
parent ba6af0fb15
commit 7918545caf
1 changed files with 4 additions and 3 deletions

View File

@ -55,16 +55,17 @@ static int vulkan_init(struct ra_hwdec *hw)
AVBufferRef *hw_device_ctx = NULL;
int ret = 0;
struct vulkan_hw_priv *p = hw->priv;
int level = hw->probing ? MSGL_V : MSGL_ERR;
struct mpvk_ctx *vk = ra_vk_ctx_get(hw->ra_ctx);
if (!vk) {
MP_ERR(hw, "This is not a libplacebo vulkan gpu api context.\n");
MP_MSG(hw, level, "This is not a libplacebo vulkan gpu api context.\n");
return 0;
}
p->gpu = ra_pl_get(hw->ra_ctx->ra);
if (!p->gpu) {
MP_ERR(hw, "Failed to obtain pl_gpu.\n");
MP_MSG(hw, level, "Failed to obtain pl_gpu.\n");
return 0;
}
@ -124,7 +125,7 @@ static int vulkan_init(struct ra_hwdec *hw)
ret = av_hwdevice_ctx_init(hw_device_ctx);
if (ret < 0) {
MP_ERR(hw, "av_hwdevice_ctx_init failed\n");
MP_MSG(hw, level, "av_hwdevice_ctx_init failed\n");
goto error;
}