/*
- Copyright (C) 2018-2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018-2020 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
BOOST_FOREACH (shared_ptr<Reel> reel, cpl->reels()) {
stage ("Checking reel", optional<boost::filesystem::path>());
+
+ BOOST_FOREACH (shared_ptr<ReelAsset> i, reel->assets()) {
+ if (i->duration() && (i->duration().get() * i->edit_rate().denominator / i->edit_rate().numerator) < 1) {
+ notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::DURATION_TOO_SMALL, i->id()));
+ }
+ if ((i->intrinsic_duration() * i->edit_rate().denominator / i->edit_rate().numerator) < 1) {
+ notes.push_back (VerificationNote(VerificationNote::VERIFY_ERROR, VerificationNote::INTRINSIC_DURATION_TOO_SMALL, i->id()));
+ }
+ }
+
if (reel->main_picture()) {
/* Check reel stuff */
Fraction const frame_rate = reel->main_picture()->frame_rate();
return "The DCP contains both SMPTE and Interop parts.";
case dcp::VerificationNote::XML_VALIDATION_ERROR:
return String::compose("An XML file is badly formed: %1 (%2:%3)", note.note().get(), note.file()->filename(), note.line().get());
+ case dcp::VerificationNote::INTRINSIC_DURATION_TOO_SMALL:
+ return String::compose("The intrinsic duration of an asset is less than 1 second long: %1", note.note().get());
+ case dcp::VerificationNote::DURATION_TOO_SMALL:
+ return String::compose("The duration of an asset is less than 1 second long: %1", note.note().get());
}
return "";
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018-2020 Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
MISMATCHED_STANDARD,
/** Some XML fails to validate against the XSD/DTD */
XML_VALIDATION_ERROR,
+ /** An asset's IntrinsicDuration is less than 1 second */
+ INTRINSIC_DURATION_TOO_SMALL,
+ /** An asset's Duration is less than 1 second */
+ DURATION_TOO_SMALL
};
VerificationNote (Type type, Code code)
next_verify_test_number++;
}
+
+/* DCP with a short asset */
+BOOST_AUTO_TEST_CASE (verify_test14)
+{
+ vector<boost::filesystem::path> directories = setup (8, next_verify_test_number);
+ list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress, "xsd");
+
+ dump_notes (notes);
+
+ BOOST_REQUIRE_EQUAL (notes.size(), 4);
+ list<dcp::VerificationNote>::const_iterator i = notes.begin ();
+ BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::DURATION_TOO_SMALL);
+ ++i;
+ BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::INTRINSIC_DURATION_TOO_SMALL);
+ ++i;
+ BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::DURATION_TOO_SMALL);
+ ++i;
+ BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::INTRINSIC_DURATION_TOO_SMALL);
+ ++i;
+ next_verify_test_number++;
+}
+