Merge master.
authorCarl Hetherington <cth@carlh.net>
Tue, 1 Jul 2014 12:59:50 +0000 (13:59 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 1 Jul 2014 12:59:50 +0000 (13:59 +0100)
22 files changed:
src/lib/cross.cc
src/lib/ffmpeg_examiner.cc
src/lib/file_group.cc
src/lib/filter_graph.cc
src/lib/internet.cc
src/lib/job_manager.cc
src/lib/json_server.cc
src/lib/resampler.cc
src/lib/server.cc
src/lib/server_finder.cc
src/lib/update.cc
src/lib/writer.cc
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_cli.cc
src/tools/dcpomatic_create.cc
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_server_cli.cc
src/tools/server_test.cc
src/wx/doremi_certificate_dialog.cc
src/wx/film_editor.cc
test/job_test.cc

index 53ef5723ac50232d5e05fb8664a7b8dc3eba766d..0224e461d5fb8193fe82841ecdb34051711b2f6a 100644 (file)
@@ -202,7 +202,7 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
 
        CloseHandle (child_stderr_write);
 
-       while (1) {
+       while (true) {
                char buffer[512];
                DWORD read;
                if (!ReadFile(child_stderr_read, buffer, sizeof(buffer), &read, 0) || read == 0) {
@@ -247,7 +247,7 @@ mount_info ()
                return m;
        }
        
-       while (1) {
+       while (true) {
                struct mntent* mnt = getmntent (f);
                if (!mnt) {
                        break;
index d9bcedfc528f196ba9a85b064d1f3900f32fdbbc..949062f5bd5c3a9e5b1eace869ffc4474007560f 100644 (file)
@@ -73,7 +73,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c)
         * where we should look for subtitles (video and audio are always present,
         * so they are ok).
         */
-       while (1) {
+       while (true) {
                int r = av_read_frame (_format_context, &_packet);
                if (r < 0) {
                        break;
index 54ec8280c0a6830da2a671137dc7a4f45336b61b..9c8d43204b1b830726c073de894e7b9f5c6e9e22 100644 (file)
@@ -151,7 +151,7 @@ int
 FileGroup::read (uint8_t* buffer, int amount) const
 {
        int read = 0;
-       while (1) {
+       while (true) {
                int const this_time = fread (buffer + read, 1, amount - read, _current_file);
                read += this_time;
                if (read == amount) {
index 5add16d19bcedac612b55eecf5bc85a7feedf99a..8b259a12d01e26c1b126c9d1296ac2632c3ee10d 100644 (file)
@@ -143,7 +143,7 @@ FilterGraph::process (AVFrame* frame)
                throw DecodeError (N_("could not push buffer into filter chain."));
        }
 
-       while (1) {
+       while (true) {
                if (av_buffersink_get_frame (_buffer_sink_context, _frame) < 0) {
                        break;
                }
index c3f9dce659522099a13b047477494307ecaf3a18..99ae5c2142ed255d3731e1a667591e811bc63bb9 100644 (file)
@@ -80,7 +80,7 @@ get_from_zip_url (string url, string file, function<void (boost::filesystem::pat
        ScopedTemporary temp_cert;
        f = temp_cert.open ("wb");
        char buffer[4096];
-       while (1) {
+       while (true) {
                int const N = zip_fread (zip_file, buffer, sizeof (buffer));
                fwrite (buffer, 1, N, f);
                if (N < int (sizeof (buffer))) {
index 056b9f925e1b237946122d804241614bb87f416c..2b727b0aaa43985942674f07d4f881051369236b 100644 (file)
@@ -106,7 +106,7 @@ JobManager::errors () const
 void
 JobManager::scheduler ()
 {
-       while (1) {
+       while (true) {
 
                bool active_jobs = false;
 
index f4aa292d7779ca8cee77af2855b489242738d6fe..1be3c7d0e9d894698534d84d6df4aaeaea265c30 100644 (file)
@@ -58,7 +58,7 @@ try
 {
        boost::asio::io_service io_service;
        tcp::acceptor a (io_service, tcp::endpoint (tcp::v4 (), port));
-       while (1) {
+       while (true) {
                try {
                        shared_ptr<tcp::socket> s (new tcp::socket (io_service));
                        a.accept (*s);
@@ -80,7 +80,7 @@ JSONServer::handle (shared_ptr<tcp::socket> socket)
        string url;
        State state = AWAITING_G;
 
-       while (1) {
+       while (true) {
                char data[MAX_LENGTH];
                boost::system::error_code error;
                size_t len = socket->read_some (boost::asio::buffer (data), error);
index 9a81df4993e5da7132938afd25db6dbf29c6d392..e414436e8b39960c6c5f78ca16188c0781bc0407 100644 (file)
@@ -89,7 +89,7 @@ Resampler::flush ()
        int64_t const pass_size = 256;
        shared_ptr<AudioBuffers> pass (new AudioBuffers (_channels, 256));
 
-       while (1) {
+       while (true) {
                int const frames = swr_convert (_swr_context, (uint8_t **) pass->data(), pass_size, 0, 0);
                
                if (frames < 0) {
index fe792e307424501b2c8a6df845c4b202f01d1504..9d1925de1a4a2c80cf0167b5f484e099c6237aab 100644 (file)
@@ -136,7 +136,7 @@ Server::process (shared_ptr<Socket> socket, struct timeval& after_read, struct t
 void
 Server::worker_thread ()
 {
-       while (1) {
+       while (true) {
                boost::mutex::scoped_lock lock (_worker_mutex);
                while (_queue.empty () && !_terminate) {
                        _empty_condition.wait (lock);
index de8a3852c5cf45c0abd52faaf94b4f08ee24e94c..9b0cd037679f9351c5a9112537dbef283235a4ed 100644 (file)
@@ -103,7 +103,7 @@ void
 ServerFinder::listen_thread ()
 try
 {
-       while (1) {
+       while (true) {
                shared_ptr<Socket> sock (new Socket (60));
 
                try {
index c7527ee493624247468b365cde6b2363acb5496f..44ecbb232c26b03214f23d3191c54fedd9a9071a 100644 (file)
@@ -90,7 +90,7 @@ UpdateChecker::run ()
 void
 UpdateChecker::thread ()
 {
-       while (1) {
+       while (true) {
                /* Block until there is something to do */
                boost::mutex::scoped_lock lock (_process_mutex);
                while (_to_do == 0) {
index 33817ca6eb8b6479b6eedec4539bae54c2faed91..489135b846e8cb7d9d20e32d00a928c8a8117256 100644 (file)
@@ -241,11 +241,11 @@ void
 Writer::thread ()
 try
 {
-       while (1)
+       while (true)
        {
                boost::mutex::scoped_lock lock (_mutex);
 
-               while (1) {
+               while (true) {
                        
                        if (_finish || _queued_full_in_memory > _maximum_frames_in_memory || have_sequenced_image_at_queue_head ()) {
                                /* We've got something to do: go and do it */
@@ -530,7 +530,7 @@ Writer::check_existing_picture_mxf ()
                ++N;
        }
 
-       while (1) {
+       while (true) {
 
                shared_ptr<Job> job = _job.lock ();
                assert (job);
index 1fb7feb7de2a8da436650af4f78de93be7101c57..fb63ae9971c35b5839b2b2ec6ebba713115efcc5 100644 (file)
@@ -392,7 +392,7 @@ private:
                        );
                
                int r;
-               while (1) {
+               while (true) {
                        r = c->ShowModal ();
                        if (r == wxID_OK && c->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
                                error_dialog (this, _("You did not select a folder.  Make sure that you select a folder before clicking Open."));
index 58fbaec985a4c369c9de547d869fd87cd9082f9e..49b341443e4bebaeae755563deae93299efd1d74 100644 (file)
@@ -173,7 +173,7 @@ private:
                }
                
                int r;
-               while (1) {
+               while (true) {
                        r = c->ShowModal ();
                        if (r == wxID_OK && c->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
                                error_dialog (this, _("You did not select a folder.  Make sure that you select a folder before clicking Open."));
index acd1335e62d5e5ef57c469232e429db29c22e6c6..7dd820b9571bc9becf931b176aabcd975e75d996 100644 (file)
@@ -69,7 +69,7 @@ main (int argc, char* argv[])
        bool keep_going = false;
 
        int option_index = 0;
-       while (1) {
+       while (true) {
                static struct option long_options[] = {
                        { "version", no_argument, 0, 'v'},
                        { "help", no_argument, 0, 'h'},
@@ -212,7 +212,7 @@ main (int argc, char* argv[])
        }
 
        if (keep_going) {
-               while (1) {
+               while (true) {
                        dcpomatic_sleep (3600);
                }
        }
index b0a67c6d93d5630fc919731ff251114c292f2690..304f4f697ab6e8a031c44dd2a74c3b896f2c448a 100644 (file)
@@ -81,7 +81,7 @@ main (int argc, char* argv[])
        boost::filesystem::path output;
        
        int option_index = 0;
-       while (1) {
+       while (true) {
                static struct option long_options[] = {
                        { "version", no_argument, 0, 'v'},
                        { "help", no_argument, 0, 'h'},
index fa14dd141ad03f210380e76fa1245b534e6d5b96..2ad07cce7a38bae73c62f2b1824def725e9ada34 100644 (file)
@@ -116,7 +116,7 @@ int main (int argc, char* argv[])
        program_name = argv[0];
        
        int option_index = 0;
-       while (1) {
+       while (true) {
                static struct option long_options[] = {
                        { "help", no_argument, 0, 'h'},
                        { "output", required_argument, 0, 'o'},
index 56802d8aef07a43b357c8371767d5d83eea33826..e4ac85f4cb6d48f47f19786238ec1a5c221fddc6 100644 (file)
@@ -66,7 +66,7 @@ main (int argc, char* argv[])
        bool write_log = false;
 
        int option_index = 0;
-       while (1) {
+       while (true) {
                static struct option long_options[] = {
                        { "version", no_argument, 0, 'v'},
                        { "help", no_argument, 0, 'h'},
index 3c2ea4b36068ecbde2eae65658cc04b75d513536..5997caab67c61b86212d3f010fb5445fcf086d69 100644 (file)
@@ -103,7 +103,7 @@ main (int argc, char* argv[])
        string film_dir;
        string server_host;
 
-       while (1) {
+       while (true) {
                static struct option long_options[] = {
                        { "help", no_argument, 0, 'h'},
                        { "server", required_argument, 0, 's'},
index b0840a83fa23f9831f7f47734957b3ce95dddcdc..b4cd14eaf200af95b740816e4a0c1db182a8b4e8 100644 (file)
@@ -26,6 +26,7 @@
 #include "wx_util.h"
 
 using std::string;
+using std::cout;
 using boost::function;
 using boost::optional;
 
@@ -52,6 +53,8 @@ DoremiCertificateDialog::download ()
        _message->SetLabel (_("Downloading certificate"));
        run_gui_loop ();
 
+       /* Try dcp2000, imb and ims prefixes (see mantis #375) */
+
        optional<string> error = get_from_zip_url (
                String::compose (
                        "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/dcp2000-%2.dcicerts.zip",
@@ -61,6 +64,28 @@ DoremiCertificateDialog::download ()
                _load
                );
 
+       if (error) {
+               error = get_from_zip_url (
+               String::compose (
+                       "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/imb-%2.dcicerts.zip",
+                       serial.substr(0, 3), serial
+                       ),
+               String::compose ("imb-%1.cert.sha256.pem", serial),
+               _load
+               );
+       }
+
+       if (error) {
+               error = get_from_zip_url (
+               String::compose (
+                       "ftp://service:t3chn1c1an@ftp.doremilabs.com/Certificates/%1xxx/ims-%2.dcicerts.zip",
+                       serial.substr(0, 3), serial
+                       ),
+               String::compose ("ims-%1.cert.sha256.pem", serial),
+               _load
+               );
+       }
+
        if (error) {
                error_dialog (this, std_to_wx (error.get ()));
        } else {
index 0c70d4b3efc3d12c092dddda5ab72be55e970b58..ee8ee6d389346598f3e013eeb236c816451eedbd 100644 (file)
@@ -876,7 +876,7 @@ FilmEditor::selected_content ()
 {
        ContentList sel;
        long int s = -1;
-       while (1) {
+       while (true) {
                s = _content->GetNextItem (s, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
                if (s == -1) {
                        break;
index 2022a8ddadf0ab5d464244b7b0124d6d1294f45b..c1b66d4e01f38f36127c49087c79473cbdb20739 100644 (file)
@@ -48,7 +48,7 @@ public:
 
        void run ()
        {
-               while (1) {
+               while (true) {
                        if (finished ()) {
                                return;
                        }