From 71a358ce70bf9156e895f3dc6515e65628950422 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 14 Feb 2018 23:17:24 +0000 Subject: [PATCH] Adapt for changes to disable_forensic variable types in libdcp. --- src/lib/film.cc | 14 ++++++++++---- src/lib/film.h | 8 ++++---- src/tools/dcpomatic.cc | 4 ++-- src/tools/dcpomatic_kdm_cli.cc | 24 ++++++++++++------------ 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/lib/film.cc b/src/lib/film.cc index 23c83d037..332353b71 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1205,6 +1205,9 @@ Film::frame_size () const * @param from KDM from time expressed as a local time with an offset from UTC. * @param until KDM to time expressed as a local time with an offset from UTC. * @param formulation KDM formulation to use. + * @param disable_forensic_marking_picture true to disable forensic marking of picture. + * @param disable_forensic_marking_audio if not set, don't disable forensic marking of audio. If set to 0, + * disable all forensic marking; if set above 0, disable forensic marking above that channel. */ dcp::EncryptedKDM Film::make_kdm ( @@ -1214,8 +1217,8 @@ Film::make_kdm ( dcp::LocalTime from, dcp::LocalTime until, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio + bool disable_forensic_marking_picture, + optional disable_forensic_marking_audio ) const { if (!_encrypted) { @@ -1274,6 +1277,9 @@ Film::make_kdm ( * @param from KDM from time expressed as a local time in the time zone of the Screen's Cinema. * @param until KDM to time expressed as a local time in the time zone of the Screen's Cinema. * @param formulation KDM formulation to use. + * @param disable_forensic_marking_picture true to disable forensic marking of picture. + * @param disable_forensic_marking_audio if not set, don't disable forensic marking of audio. If set to 0, + * disable all forensic marking; if set above 0, disable forensic marking above that channel. */ list Film::make_kdms ( @@ -1282,8 +1288,8 @@ Film::make_kdms ( boost::posix_time::ptime from, boost::posix_time::ptime until, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio + bool disable_forensic_marking_picture, + optional disable_forensic_marking_audio ) const { list kdms; diff --git a/src/lib/film.h b/src/lib/film.h index 67bcfbbdf..355a41da5 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -131,8 +131,8 @@ public: dcp::LocalTime from, dcp::LocalTime until, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio + bool disable_forensic_marking_picture, + boost::optional disable_forensic_marking_audio ) const; std::list make_kdms ( @@ -141,8 +141,8 @@ public: boost::posix_time::ptime from, boost::posix_time::ptime until, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio + bool disable_forensic_marking_picture, + boost::optional disable_forensic_marking_audio ) const; int state_version () const { diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 4d6b38d5c..05534cc60 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -733,8 +733,8 @@ private: dcp::LocalTime ("2012-01-01T01:00:00+00:00"), dcp::LocalTime ("2112-01-01T01:00:00+00:00"), dcp::MODIFIED_TRANSITIONAL_1, - -1, - -1 + true, + 0 ); } catch (dcp::NotEncryptedError& e) { error_dialog (this, _("CPL's content is not encrypted.")); diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index fbd6bb870..f632d808a 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -194,8 +194,8 @@ from_film ( boost::posix_time::ptime valid_from, boost::posix_time::ptime valid_to, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio, + bool disable_forensic_marking_picture, + optional disable_forensic_marking_audio, bool zip ) { @@ -277,8 +277,8 @@ kdm_from_dkdm ( dcp::LocalTime valid_from, dcp::LocalTime valid_to, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio + bool disable_forensic_marking_picture, + optional disable_forensic_marking_audio ) { /* Signer for new KDM */ @@ -314,8 +314,8 @@ from_dkdm ( boost::posix_time::ptime valid_from, boost::posix_time::ptime valid_to, dcp::Formulation formulation, - int disable_forensic_marking_picture, - int disable_forensic_marking_audio, + bool disable_forensic_marking_picture, + optional disable_forensic_marking_audio, bool zip ) { @@ -399,8 +399,8 @@ int main (int argc, char* argv[]) optional duration_string; bool verbose = false; dcp::Formulation formulation = dcp::MODIFIED_TRANSITIONAL_1; - int disable_forensic_marking_picture = 0; - int disable_forensic_marking_audio = 0; + bool disable_forensic_marking_picture = false; + optional disable_forensic_marking_audio; program_name = argv[0]; @@ -470,13 +470,13 @@ int main (int argc, char* argv[]) } break; case 'p': - disable_forensic_marking_picture = -1; + disable_forensic_marking_picture = true; break; case 'a': - disable_forensic_marking_audio = -1; - if (optarg == NULL && argv[optind] != NULL && argv[optind][0] != '-') { + disable_forensic_marking_audio = 0; + if (optarg == 0 && argv[optind] != 0 && argv[optind][0] != '-') { disable_forensic_marking_audio = atoi (argv[optind++]); - } else if (optarg != NULL) { + } else if (optarg) { disable_forensic_marking_audio = atoi (optarg); } break; -- 2.30.2