mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-28 06:59:11 +00:00
feat(libplacebo): made hardware context creation failure non-critical
Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
parent
aa8ed60e52
commit
c8f2acdea6
@ -29,8 +29,8 @@ int init_libplacebo(
|
|||||||
&vk_hw_device_ctx, AV_HWDEVICE_TYPE_VULKAN, std::to_string(vk_device_index).c_str(), NULL, 0
|
&vk_hw_device_ctx, AV_HWDEVICE_TYPE_VULKAN, std::to_string(vk_device_index).c_str(), NULL, 0
|
||||||
);
|
);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
spdlog::error("Failed to create Vulkan hardware device context.");
|
spdlog::error("Failed to create Vulkan hardware device context for libplacebo.");
|
||||||
return ret;
|
vk_hw_device_ctx = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVFilterGraph *graph = avfilter_graph_alloc();
|
AVFilterGraph *graph = avfilter_graph_alloc();
|
||||||
@ -118,8 +118,10 @@ int init_libplacebo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the hardware device context to Vulkan
|
// Set the hardware device context to Vulkan
|
||||||
libplacebo_ctx->hw_device_ctx = av_buffer_ref(vk_hw_device_ctx);
|
if (vk_hw_device_ctx != nullptr) {
|
||||||
av_buffer_unref(&vk_hw_device_ctx);
|
libplacebo_ctx->hw_device_ctx = av_buffer_ref(vk_hw_device_ctx);
|
||||||
|
av_buffer_unref(&vk_hw_device_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
// Link buffersrc to libplacebo
|
// Link buffersrc to libplacebo
|
||||||
ret = avfilter_link(last_filter, 0, libplacebo_ctx, 0);
|
ret = avfilter_link(last_filter, 0, libplacebo_ctx, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user