From: Carl Hetherington Date: Thu, 25 Jul 2013 15:21:51 +0000 (+0100) Subject: Try to be more careful when loading FrameInfos from disk. X-Git-Tag: v2.0.48~1337^2~129 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=290daefb79ec399cf7ba54968fc7e92e375e98d6;p=dcpomatic.git Try to be more careful when loading FrameInfos from disk. --- diff --git a/src/lib/job.h b/src/lib/job.h index eb09ba386..9b8b14a93 100644 --- a/src/lib/job.h +++ b/src/lib/job.h @@ -70,6 +70,9 @@ public: void ascend (); void descend (float); float overall_progress () const; + bool progress_unknown () const { + return _progress_unknown; + } boost::signals2::signal Progress; /** Emitted from the UI thread when the job is finished */ diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 522ecc1c1..4c8a36597 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -411,6 +411,10 @@ Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes) /* Read the frame info as written */ ifstream ifi (_film->info_path (f, eyes).c_str()); libdcp::FrameInfo info (ifi); + if (info.size == 0) { + _film->log()->log (String::compose ("Existing frame %1 has no info file", f)); + return false; + } /* Read the data from the MXF and hash it */ fseek (mxf, info.offset, SEEK_SET); diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index 20f885a9b..b627edc2f 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -43,7 +43,6 @@ public: , _window (window) , _panel (panel) , _table (table) - , _needs_pulse (false) { int n = 0; @@ -86,11 +85,9 @@ public: void maybe_pulse () { - if (_job->running() && _needs_pulse) { + if (_job->running() && _job->progress_unknown ()) { _gauge->Pulse (); } - - _needs_pulse = true; } private: @@ -101,7 +98,6 @@ private: if (p >= 0) { checked_set (_message, _job->status ()); _gauge->SetValue (p * 100); - _needs_pulse = false; } _table->Layout (); @@ -156,7 +152,6 @@ private: wxButton* _cancel; wxButton* _pause; wxButton* _details; - bool _needs_pulse; }; /** Must be called in the GUI thread */