Fix ffprobe on windows to work without a command window etc.
[dcpomatic.git] / src / lib / film.cc
index 041bbc22503c624c447a0ed4e5eca3ecad16849c..3d9b3eeb4e4f8fafff480bc8bdf78fa180b1ee81 100644 (file)
@@ -999,20 +999,7 @@ Film::set_content (string c)
                set_use_content_audio (false);
        }
 
-#ifdef DVDOMATIC_WINDOWS
-       wchar_t dir[512];
-       GetModuleFileName (GetModuleHandle (0), dir, sizeof (dir));
-       boost::filesystem::path path_dir (dir);
-       path_dir = path_dir.parent_path ();
-       path_dir /= "ffprobe.exe";
-       string ffprobe = "\"" + path_dir.string () + "\" ";
-#else
-       string ffprobe = "ffprobe ";
-#endif
-       ffprobe += "\"" + c + "\"";
-       ffprobe += " 2> \"" + file ("ffprobe.log") + "\"";
-       log()->log (String::compose ("Probing with %1", ffprobe));
-       system (ffprobe.c_str ());
+       run_ffprobe (c, file ("ffprobe.log"), _log);
 }
 
 void