Skip to content

Commit

Permalink
Fixed bug in ViSQOL model file extraction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bruse committed Apr 26, 2024
1 parent 23c5e4f commit 46cdda4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cpp/zimt/visqol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@

#include "zimt/visqol.h"

#include <iostream>
#include <cerrno>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <random>
#include <string>
#include <vector>

#include "absl/log/check.h"
#include "absl/types/span.h"
Expand All @@ -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<char> 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()));
Expand Down
Binary file modified go/goohrli/goohrli.a
Binary file not shown.

0 comments on commit 46cdda4

Please sign in to comment.