Debugging for encode decisions.
[dcpomatic.git] / src / lib / cross.cc
index 7cb5b3e8eed1bbaf7af853f7e1f792e60bccd8cb..454fe044cb51b2e19b3c646ba4d87738cbf762dc 100644 (file)
@@ -1,19 +1,20 @@
 /*
     Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
-    This program is free software; you can redistribute it and/or modify
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
-    This program is distributed in the hope that it will be useful,
+    DCP-o-matic is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
@@ -367,7 +368,7 @@ start_batch_converter (boost::filesystem::path dcpomatic)
        batch = batch.parent_path (); // Contents
        batch = batch.parent_path (); // DCP-o-matic.app
        batch = batch.parent_path (); // Applications
-       batch /= "DCP-o-matic 2 Batch Converter.app";
+       batch /= "DCP-o-matic\\ 2\\ Batch\\ Converter.app";
        batch /= "Contents";
        batch /= "MacOS";
        batch /= "dcpomatic2_batch";
@@ -376,6 +377,7 @@ start_batch_converter (boost::filesystem::path dcpomatic)
 #if defined(DCPOMATIC_LINUX) || defined(DCPOMATIC_OSX)
        pid_t pid = fork ();
        if (pid == 0) {
+               std::cout << "start " << batch << " from " << dcpomatic << "\n";
                int const r = system (batch.string().c_str());
                exit (WEXITSTATUS (r));
        }
@@ -388,6 +390,19 @@ start_batch_converter (boost::filesystem::path dcpomatic)
 
        PROCESS_INFORMATION process_info;
        ZeroMemory (&process_info, sizeof (process_info));
-       CreateProcess (0, batch.string().c_str(), 0, 0, FALSE, 0, 0, 0, &startup_info, &process_info);
+
+       wchar_t cmd[512];
+       MultiByteToWideChar (CP_UTF8, 0, batch.string().c_str(), -1, cmd, sizeof(cmd));
+       CreateProcess (0, cmd, 0, 0, FALSE, 0, 0, 0, &startup_info, &process_info);
+#endif
+}
+
+uint64_t
+thread_id ()
+{
+#ifdef DCPOMATIC_WINDOWS
+       return (uint64_t) GetCurrentThreadId ();
+#else
+       return (uint64_t) pthread_self ();
 #endif
 }