mirror of
https://github.com/k4yt3x/video2x.git
synced 2024-12-28 23:19:11 +00:00
fix(libplacebo): fixed libplacebo shader path formatting on Windows
Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
parent
48119a30eb
commit
9d342c51a2
@ -72,16 +72,23 @@ int init_libplacebo(
|
||||
#endif
|
||||
|
||||
// Prepare the filter arguments
|
||||
char filter_args[512];
|
||||
snprintf(
|
||||
char filter_args[4096];
|
||||
int filter_args_size = snprintf(
|
||||
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_height,
|
||||
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;
|
||||
ret = avfilter_graph_create_filter(
|
||||
&libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args, NULL, graph
|
||||
|
Loading…
Reference in New Issue
Block a user