fix(libplacebo): fixed libplacebo shader path formatting on Windows

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
k4yt3x 2024-10-28 00:00:00 +00:00
parent 48119a30eb
commit 9d342c51a2
No known key found for this signature in database

View File

@ -72,16 +72,23 @@ int init_libplacebo(
#endif #endif
// Prepare the filter arguments // Prepare the filter arguments
char filter_args[512]; char filter_args[4096];
snprintf( int filter_args_size = snprintf(
filter_args, filter_args,
sizeof(filter_args), sizeof(filter_args),
"w=%d:h=%d:upscaler=ewa_lanczos:custom_shader_path=%s", "w=%d:h=%d:custom_shader_path='%s'",
out_width, out_width,
out_height, out_height,
shader_path_string.c_str() shader_path_string.c_str()
); );
// Check if the filter arguments are too long
if (filter_args_size < 0 || filter_args_size >= static_cast<int>(sizeof(filter_args))) {
spdlog::error("libplacebo filter arguments too long.");
avfilter_graph_free(&graph);
return AVERROR(EINVAL);
}
AVFilterContext *libplacebo_ctx; AVFilterContext *libplacebo_ctx;
ret = avfilter_graph_create_filter( ret = avfilter_graph_create_filter(
&libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args, NULL, graph &libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args, NULL, graph