Fix up some bugs when using limited DCP range (reported by Wolfgang Woehl).
authorCarl Hetherington <cth@carlh.net>
Sun, 7 Oct 2012 21:51:06 +0000 (22:51 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 7 Oct 2012 21:51:06 +0000 (22:51 +0100)
ChangeLog
src/lib/check_hashes_job.cc
src/lib/film_state.cc
src/lib/film_state.h
src/lib/transcode_job.cc

index d34b781b6b8374d1eb0c36166d3907ccd50eae8b..58876926e2ca6b2193b835c8472b32a7907e894a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-07  Carl Hetherington  <cth@carlh.net>
+
+       * Fix up some bugs when using limited DCP
+       range (reported by Wolfgang Woehl).
+
 2012-10-02  Carl Hetherington  <cth@carlh.net>
 
        * Version 0.54 released.
index cf269564aa7f2dc81717907249e087fef2c5d835..f60a2d40d62cff94e24473503dc5a84e733e7357 100644 (file)
@@ -48,8 +48,10 @@ void
 CheckHashesJob::run ()
 {
        _bad = 0;
+
+       int const N = _fs->dcp_length ();
        
-       for (int i = 0; i < _fs->length; ++i) {
+       for (int i = 0; i < N; ++i) {
                string const j2k_file = _opt->frame_out_path (i, false);
                string const hash_file = j2k_file + ".md5";
 
index d7d9a1462a7896e2581838f855b575e4d232bbb7..3cd7091ca69ebdb62a8706c652dc7113d63f8779 100644 (file)
@@ -299,3 +299,15 @@ FilmState::target_sample_rate () const
 
        return rint (t);
 }
+
+int
+FilmState::dcp_length () const
+{
+       if (dcp_frames) {
+               return dcp_frames;
+       }
+
+       return length;
+}
+
+                       
index 8dc0ce11bf320cde84f09e79ec17cd7be6dc47ca..16a1b0508d80f6daaced489fb6b0e34819399515 100644 (file)
@@ -87,6 +87,8 @@ public:
 
        Size cropped_size (Size) const;
 
+       int dcp_length () const;
+
        /** Complete path to directory containing the film metadata;
            must not be relative.
        */
index e79be09feb04779d8603c20bbd2bc881b9fc09b2..e1ba82359357ec203ff7e7ff12a10f9557caa8ad 100644 (file)
@@ -107,5 +107,5 @@ TranscodeJob::remaining_time () const
                return 0;
        }
 
-       return ((_fs->length - _encoder->last_frame()) / fps);
+       return ((_fs->dcp_length() - _encoder->last_frame()) / fps);
 }