Added a configuration option to specify ffmpeg binary location #5

This commit is contained in:
emeric
2019-10-25 13:51:59 +02:00
parent 4ab91aea44
commit 88570d7f0b
4 changed files with 12 additions and 52 deletions
-25
View File
@@ -28,31 +28,6 @@
#include "utils/Exception.hpp"
#include "utils/Logger.hpp"
std::filesystem::path searchExecPath(std::string filename)
{
std::string path;
path = ::getenv("PATH");
if (path.empty())
throw LmsException("Environment variable PATH not found");
std::string result;
using tokenizer = boost::tokenizer<boost::char_separator<char>>;
boost::char_separator<char> sep(":");
tokenizer tok(path, sep);
for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it)
{
std::filesystem::path p = *it;
p /= filename;
if (!::access(p.c_str(), X_OK))
{
result = p.string();
break;
}
}
return result;
}
void computeCrc(const std::filesystem::path& p, std::vector<unsigned char>& crc)
{
using crc_type = boost::crc_32_type;