summaryrefslogtreecommitdiff
path: root/src/lib/cross_osx.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-08-24 15:43:06 +0200
committerCarl Hetherington <cth@carlh.net>2023-08-26 10:23:21 +0200
commitef281445a58b4025a9cf77b24ebe551737a787bf (patch)
tree6f4ee77febd0452b611d391e6eae1fe32989e756 /src/lib/cross_osx.cc
parente8800b7efc51b6e0c186a7bd733e014a3093a384 (diff)
Extend run_ffprobe to allow arguments and capture of stdout.
Diffstat (limited to 'src/lib/cross_osx.cc')
-rw-r--r--src/lib/cross_osx.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc
index 3b04f1011..0f25732f2 100644
--- a/src/lib/cross_osx.cc
+++ b/src/lib/cross_osx.cc
@@ -103,13 +103,18 @@ libdcp_resources_path ()
void
-run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
+run_ffprobe(boost::filesystem::path content, boost::filesystem::path out, bool err, string args)
{
auto path = directory_containing_executable () / "ffprobe";
+ if (!boost::filesystem::exists(path)) {
+ /* This is a hack but we need ffprobe during tests */
+ path = "/Users/ci/workspace/bin/ffprobe";
+ }
+ string const redirect = err ? "2>" : ">";
- string ffprobe = "\"" + path.string() + "\" \"" + content.string() + "\" 2> \"" + out.string() + "\"";
+ auto const ffprobe = String::compose("\"%1\" %2 \"%3\" %4 \"%5\"", path, args.empty() ? " " : args, content.string(), redirect, out.string());
LOG_GENERAL (N_("Probing with %1"), ffprobe);
- system (ffprobe.c_str ());
+ system (ffprobe.c_str());
}