summaryrefslogtreecommitdiff
path: root/src/lib/cross_linux.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_linux.cc
parente8800b7efc51b6e0c186a7bd733e014a3093a384 (diff)
Extend run_ffprobe to allow arguments and capture of stdout.
Diffstat (limited to 'src/lib/cross_linux.cc')
-rw-r--r--src/lib/cross_linux.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc
index 919927fda..0a12d7cca 100644
--- a/src/lib/cross_linux.cc
+++ b/src/lib/cross_linux.cc
@@ -99,9 +99,10 @@ 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)
{
- string ffprobe = "ffprobe \"" + content.string() + "\" 2> \"" + out.string() + "\"";
+ string const redirect = err ? "2>" : ">";
+ auto const ffprobe = String::compose("ffprobe %1 \"%2\" %3 \"%4\"", args.empty() ? " " : args, content.string(), redirect, out.string());
LOG_GENERAL (N_("Probing with %1"), ffprobe);
int const r = system (ffprobe.c_str());
if (r == -1 || (WIFEXITED(r) && WEXITSTATUS(r) != 0)) {