operator bool on Time is a really bad idea; removed it and fixed lots of bugs.
[dcpomatic.git] / src / lib / writer.cc
index 6c63314865dae6f9b760a7f94373d533d13577fa..33b7dd51ed00c04ed754ff7d7653cb5dead9639e 100644 (file)
@@ -292,16 +292,16 @@ try
                        _last_written_frame = qi.frame;
                        _last_written_eyes = qi.eyes;
                        
-                       if (_film->length()) {
-                               shared_ptr<Job> job = _job.lock ();
-                               assert (job);
-                               int64_t total = _film->length().frames (_film->video_frame_rate ());
-                               if (_film->three_d ()) {
-                                       /* _full_written and so on are incremented for each eye, so we need to double the total
-                                          frames to get the correct progress.
-                                       */
-                                       total *= 2;
-                               }
+                       shared_ptr<Job> job = _job.lock ();
+                       assert (job);
+                       int64_t total = _film->length().frames (_film->video_frame_rate ());
+                       if (_film->three_d ()) {
+                               /* _full_written and so on are incremented for each eye, so we need to double the total
+                                  frames to get the correct progress.
+                               */
+                               total *= 2;
+                       }
+                       if (total) {
                                job->set_progress (float (_full_written + _fake_written + _repeat_written) / total);
                        }
                }