diff options
| -rw-r--r-- | platform/osx/make_dmg.sh | 1 | ||||
| -rw-r--r-- | src/lib/cross.cc | 24 |
2 files changed, 23 insertions, 2 deletions
diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index ab4d3624e..da943faef 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -47,6 +47,7 @@ universal_copy $ROOT lib/libavcodec*.dylib $WORK/$libs universal_copy $ROOT lib/libswscale*.dylib $WORK/$libs universal_copy $ROOT lib/libpostproc*.dylib $WORK/$libs universal_copy $ROOT lib/libswresample*.dylib $WORK/$libs +universal_copy $ROOT bin/ffprobe $WORK/$macos universal_copy $ENV lib/libboost_system.dylib $WORK/$libs universal_copy $ENV lib/libboost_filesystem.dylib $WORK/$libs universal_copy $ENV lib/libboost_thread.dylib $WORK/$libs 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> > |
