mirror of
https://github.com/k4yt3x/video2x.git
synced 2025-01-01 10:29:09 +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
|
#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
|
||||||
|
Loading…
Reference in New Issue
Block a user