diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-07 22:51:06 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-07 22:51:06 +0100 |
| commit | 97675be04d4a87e00c99733ee7b904ccbe632994 (patch) | |
| tree | 365f3795f3eb6a643e18b9e5d7c1fe978f60e372 /src/lib | |
| parent | bed01a8e72f31e73ea8f206f9b18d5910416e0c2 (diff) | |
Fix up some bugs when using limited DCP range (reported by Wolfgang Woehl).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/check_hashes_job.cc | 4 | ||||
| -rw-r--r-- | src/lib/film_state.cc | 12 | ||||
| -rw-r--r-- | src/lib/film_state.h | 2 | ||||
| -rw-r--r-- | src/lib/transcode_job.cc | 2 |
4 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/check_hashes_job.cc b/src/lib/check_hashes_job.cc index cf269564a..f60a2d40d 100644 --- a/src/lib/check_hashes_job.cc +++ b/src/lib/check_hashes_job.cc @@ -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"; diff --git a/src/lib/film_state.cc b/src/lib/film_state.cc index d7d9a1462..3cd7091ca 100644 --- a/src/lib/film_state.cc +++ b/src/lib/film_state.cc @@ -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; +} + + diff --git a/src/lib/film_state.h b/src/lib/film_state.h index 8dc0ce11b..16a1b0508 100644 --- a/src/lib/film_state.h +++ b/src/lib/film_state.h @@ -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. */ diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index e79be09fe..e1ba82359 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -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); } |
