diff --git a/src/fsutils.cpp b/src/fsutils.cpp index 7e7ff39..1706df9 100644 --- a/src/fsutils.cpp +++ b/src/fsutils.cpp @@ -20,7 +20,7 @@ static std::filesystem::path get_executable_directory() { std::vector filepath(MAX_PATH); // Get the executable path, expanding the buffer if necessary - DWORD size = GetModuleFileNameW(NULL, filepath.data(), static_cast(filepath.size())); + DWORD size = GetModuleFileNameW(nullptr, filepath.data(), static_cast(filepath.size())); if (size == 0) { logger()->error("Error getting executable path: {}", GetLastError()); return std::filesystem::path(); @@ -29,7 +29,7 @@ static std::filesystem::path get_executable_directory() { // Resize the buffer if necessary while (size >= filepath.size()) { filepath.resize(filepath.size() * 2); - size = GetModuleFileNameW(NULL, filepath.data(), static_cast(filepath.size())); + size = GetModuleFileNameW(nullptr, filepath.data(), static_cast(filepath.size())); if (size == 0) { logger()->error("Error getting executable path: {}", GetLastError()); return std::filesystem::path(); diff --git a/src/libplacebo.cpp b/src/libplacebo.cpp index dc0bb34..f889350 100644 --- a/src/libplacebo.cpp +++ b/src/libplacebo.cpp @@ -1,6 +1,5 @@ #include "libplacebo.h" -#include #include #include @@ -31,7 +30,11 @@ int init_libplacebo( // Create the Vulkan hardware device context AVBufferRef* vk_hw_device_ctx = nullptr; ret = av_hwdevice_ctx_create( - &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(), + nullptr, + 0 ); if (ret < 0) { logger()->error("Failed to create Vulkan hardware device context for libplacebo."); @@ -68,21 +71,22 @@ int init_libplacebo( AVClass* priv_class_copy_ptr = &priv_class_copy; // Check if the colorspace option is supported - if (av_opt_find(&priv_class_copy_ptr, "colorspace", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)) { + if (av_opt_find(&priv_class_copy_ptr, "colorspace", nullptr, 0, AV_OPT_SEARCH_FAKE_OBJ)) { args += ":colorspace=" + std::to_string(dec_ctx->colorspace); } else { logger()->warn("Option 'colorspace' is not supported by the buffer filter."); } // Check if the range option is supported - if (av_opt_find(&priv_class_copy_ptr, "range", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)) { + if (av_opt_find(&priv_class_copy_ptr, "range", nullptr, 0, AV_OPT_SEARCH_FAKE_OBJ)) { args += ":range=" + std::to_string(dec_ctx->color_range); } else { logger()->warn("Option 'range' is not supported by the buffer filter."); } logger()->debug("Buffer source args: {}", args); - ret = avfilter_graph_create_filter(buffersrc_ctx, buffersrc, "in", args.c_str(), NULL, graph); + ret = + avfilter_graph_create_filter(buffersrc_ctx, buffersrc, "in", args.c_str(), nullptr, graph); if (ret < 0) { logger()->error("Cannot create buffer source."); avfilter_graph_free(&graph); @@ -114,7 +118,7 @@ int init_libplacebo( AVFilterContext* libplacebo_ctx; ret = avfilter_graph_create_filter( - &libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args.c_str(), NULL, graph + &libplacebo_ctx, libplacebo_filter, "libplacebo", filter_args.c_str(), nullptr, graph ); if (ret < 0) { logger()->error("Cannot create libplacebo filter."); @@ -140,7 +144,7 @@ int init_libplacebo( // Create buffer sink const AVFilter* buffersink = avfilter_get_by_name("buffersink"); - ret = avfilter_graph_create_filter(buffersink_ctx, buffersink, "out", NULL, NULL, graph); + ret = avfilter_graph_create_filter(buffersink_ctx, buffersink, "out", nullptr, nullptr, graph); if (ret < 0) { logger()->error("Cannot create buffer sink."); avfilter_graph_free(&graph); @@ -156,7 +160,7 @@ int init_libplacebo( } // Configure the filter graph - ret = avfilter_graph_config(graph, NULL); + ret = avfilter_graph_config(graph, nullptr); if (ret < 0) { logger()->error("Error configuring the filter graph."); avfilter_graph_free(&graph); diff --git a/src/libvideo2x.cpp b/src/libvideo2x.cpp index a2149f6..751e9c3 100644 --- a/src/libvideo2x.cpp +++ b/src/libvideo2x.cpp @@ -58,7 +58,7 @@ int VideoProcessor::process( // Initialize hardware device context if (hw_device_type_ != AV_HWDEVICE_TYPE_NONE) { AVBufferRef* tmp_hw_ctx = nullptr; - ret = av_hwdevice_ctx_create(&tmp_hw_ctx, hw_device_type_, NULL, NULL, 0); + ret = av_hwdevice_ctx_create(&tmp_hw_ctx, hw_device_type_, nullptr, nullptr, 0); if (ret < 0) { return handle_error(ret, "Error initializing hardware device context"); }