projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some missing frame_done()s.
[dcpomatic.git]
/
src
/
lib
/
check_hashes_job.cc
diff --git
a/src/lib/check_hashes_job.cc
b/src/lib/check_hashes_job.cc
index 88233ab665805c34b60328895375ba3a67c1ae5c..55a744552162ff5b48153e4b32aeab87e9e4afb1 100644
(file)
--- a/
src/lib/check_hashes_job.cc
+++ b/
src/lib/check_hashes_job.cc
@@
-27,15
+27,16
@@
#include "ab_transcode_job.h"
#include "transcode_job.h"
#include "film.h"
#include "ab_transcode_job.h"
#include "transcode_job.h"
#include "film.h"
+#include "exceptions.h"
using std::string;
using std::stringstream;
using std::ifstream;
using boost::shared_ptr;
using std::string;
using std::stringstream;
using std::ifstream;
using boost::shared_ptr;
-CheckHashesJob::CheckHashesJob (shared_ptr<Film> f,
shared_ptr<const Options>
o, shared_ptr<Job> req)
+CheckHashesJob::CheckHashesJob (shared_ptr<Film> f,
DecodeOptions
o, shared_ptr<Job> req)
: Job (f, req)
: Job (f, req)
- , _opt (o)
+ , _
decode_
opt (o)
, _bad (0)
{
, _bad (0)
{
@@
-52,11
+53,14
@@
CheckHashesJob::run ()
{
_bad = 0;
{
_bad = 0;
- int const N = _film->dcp_length ();
+ if (!_film->dcp_intrinsic_duration()) {
+ throw EncodeError ("cannot check hashes of a DCP with unknown intrinsic duration");
+ }
+ int const N = _film->dcp_intrinsic_duration().get();
for (int i = 0; i < N; ++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"
;
+ string const j2k_file = _
film
->frame_out_path (i, false);
+ string const hash_file =
_film->hash_out_path (i, false)
;
if (!boost::filesystem::exists (j2k_file)) {
_film->log()->log (String::compose ("Frame %1 has a missing J2K file.", i));
if (!boost::filesystem::exists (j2k_file)) {
_film->log()->log (String::compose ("Frame %1 has a missing J2K file.", i));
@@
-78,20
+82,20
@@
CheckHashesJob::run ()
}
}
}
}
- set_progress (float (i) /
_film->length()
);
+ set_progress (float (i) /
N
);
}
if (_bad) {
shared_ptr<Job> tc;
if (_film->dcp_ab()) {
}
if (_bad) {
shared_ptr<Job> tc;
if (_film->dcp_ab()) {
- tc.reset (new ABTranscodeJob (_film, _opt, shared_from_this()));
+ tc.reset (new ABTranscodeJob (_film, _
decode_
opt, shared_from_this()));
} else {
} else {
- tc.reset (new TranscodeJob (_film, _opt, shared_from_this()));
+ tc.reset (new TranscodeJob (_film, _
decode_
opt, shared_from_this()));
}
JobManager::instance()->add_after (shared_from_this(), tc);
}
JobManager::instance()->add_after (shared_from_this(), tc);
- JobManager::instance()->add_after (tc, shared_ptr<Job> (new CheckHashesJob (_film, _opt, tc)));
+ JobManager::instance()->add_after (tc, shared_ptr<Job> (new CheckHashesJob (_film, _
decode_
opt, tc)));
}
set_progress (1);
}
set_progress (1);