Fix progress reporting for 3D DCPs.
authorCarl Hetherington <cth@carlh.net>
Wed, 18 Dec 2013 16:21:16 +0000 (16:21 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 Dec 2013 16:21:16 +0000 (16:21 +0000)
ChangeLog
src/lib/writer.cc

index 95b641cb0e00765f4123c3519bc99a5130f7f087..8cd2c6d3649965398014b4dc8e31da9f5ded8876 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-12-18  Carl Hetherington  <cth@carlh.net>
 
+       * Fix progress reporting when making 3D DCPs.
+
        * Fix non-update of display when changing video frame type (2D,
        3D left/right etc.)
 
index 4c9749d890bbfb199b067f4de3de38ec031274ab..109447f73de527a7e57a95cef905893bb6e58ceb 100644 (file)
@@ -274,9 +274,14 @@ try
                        if (_film->length()) {
                                shared_ptr<Job> job = _job.lock ();
                                assert (job);
-                               job->set_progress (
-                                       float (_full_written + _fake_written + _repeat_written) / _film->time_to_video_frames (_film->length())
-                                       );
+                               int total = _film->time_to_video_frames (_film->length ());
+                               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;
+                               }
+                               job->set_progress (float (_full_written + _fake_written + _repeat_written) / total);
                        }
                }