diff --git a/cmake/tests.cmake b/cmake/tests.cmake index 2519ea9..2b62002 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -44,7 +44,6 @@ add_test(NAME zimtohrli_loudness_computation_ipynb_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) - add_test(NAME zimtohrli_go_test COMMAND go test ./... WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/cpp/zimt/visqol.cc b/cpp/zimt/visqol.cc index 53f640e..0397d20 100644 --- a/cpp/zimt/visqol.cc +++ b/cpp/zimt/visqol.cc @@ -14,7 +14,13 @@ #include "zimt/visqol.h" -#include +#include +#include +#include +#include +#include +#include +#include #include "absl/log/check.h" #include "absl/types/span.h" @@ -27,13 +33,14 @@ constexpr size_t SAMPLE_RATE = 48000; namespace zimtohrli { ViSQOL::ViSQOL() { - std::string path_template = (std::filesystem::path(std::string(P_tmpdir)) / + std::string path_template = (std::filesystem::temp_directory_path() / "zimtohrli_cpp_zimt_visqol_model_XXXXXX") .string(); std::vector populated_path_template(path_template.begin(), path_template.end()); - int model_path_file = mkstemp(populated_path_template.data()); - CHECK_GT(model_path_file, 0); + populated_path_template.push_back('\0'); + const int model_path_file = mkstemp(populated_path_template.data()); + CHECK_GT(model_path_file, 0) << strerror(errno); CHECK_EQ(close(model_path_file), 0); model_path_ = std::filesystem::path(std::string( populated_path_template.data(), populated_path_template.size())); diff --git a/cpp/zimt/visqol_model.cc b/cpp/zimt/visqol_model.cc index ea5afc6..ccdc5c2 100644 --- a/cpp/zimt/visqol_model.cc +++ b/cpp/zimt/visqol_model.cc @@ -19,7 +19,7 @@ namespace zimtohrli { -absl::Span ViSQOLModel() { +absl::Span ViSQOLModel() { return absl::Span(reinterpret_cast(visqol_model_bytes), visqol_model_bytes_len); } diff --git a/cpp/zimt/visqol_model.h b/cpp/zimt/visqol_model.h index f4479aa..32d308c 100644 --- a/cpp/zimt/visqol_model.h +++ b/cpp/zimt/visqol_model.h @@ -20,7 +20,7 @@ namespace zimtohrli { // Returns the bytes of the default ViSQOL model. -absl::Span ViSQOLModel(); +absl::Span ViSQOLModel(); } // namespace zimtohrli diff --git a/go/goohrli/goohrli.a b/go/goohrli/goohrli.a index 733e8fc..963ed43 100644 Binary files a/go/goohrli/goohrli.a and b/go/goohrli/goohrli.a differ