summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-27 19:40:36 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-27 19:40:36 +0100
commit264ad4c84c7ab2e55efcf3b15e3d13db58fb6c5c (patch)
treef4b67e3c6466609148e49986fd14e3fd7cd2eadc /src/lib
parent478417f4441c50aaebc3870a5e1867f7c41b4afd (diff)
Port ffprobe fix for OS X.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cross.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 5ecbedf6e..61ec8de5e 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -33,6 +33,7 @@
#endif
#ifdef DCPOMATIC_OSX
#include <sys/sysctl.h>
+#include <mach-o/dyld.h>
#endif
using std::pair;
@@ -179,11 +180,30 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
CloseHandle (process_info.hProcess);
CloseHandle (process_info.hThread);
CloseHandle (child_stderr_read);
-#else
+#endif
+
+#ifdef DCPOMATIC_LINUX
string ffprobe = "ffprobe \"" + content.string() + "\" 2> \"" + out.string() + "\"";
log->log (String::compose ("Probing with %1", ffprobe));
+ system (ffprobe.c_str ());
+#endif
+
+#ifdef DCPOMATIC_OSX
+ uint32_t size = 1024;
+ char buffer[size];
+ if (_NSGetExecutablePath (buffer, &size)) {
+ log->log ("_NSGetExecutablePath failed");
+ return;
+ }
+
+ boost::filesystem::path path (buffer);
+ path.remove_filename ();
+ path /= "ffprobe";
+
+ string ffprobe = path.string() + " \"" + content.string() + "\" 2> \"" + out.string() + "\"";
+ log->log (String::compose ("Probing with %1", ffprobe));
system (ffprobe.c_str ());
-#endif
+#endif
}
list<pair<string, string> >