diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-03-02 23:10:55 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-03-08 10:31:03 +0000 |
| commit | bdae32bb84672026c1a373e809804109e95accf4 (patch) | |
| tree | 2bc51cc43f10a87503661a4829d1d34dbaf7549a /src/lib | |
| parent | 581ea73e56388d87a0c7f736efce447076618393 (diff) | |
Take notice of cinema time zones when making KDMs (#788).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 24 | ||||
| -rw-r--r-- | src/lib/film.h | 6 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 1b0f14095..e669ea4ae 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -50,6 +50,7 @@ #include "ffmpeg_content.h" #include "dcp_content.h" #include "screen_kdm.h" +#include "cinema.h" #include <libcxml/cxml.h> #include <dcp/cpl.h> #include <dcp/certificate_chain.h> @@ -1163,6 +1164,9 @@ Film::frame_size () const return fit_ratio_within (container()->ratio(), full_frame ()); } +/** @param from KDM from time expressed as a local time with an offset from UTC + * @param to KDM to time expressed as a local time with an offset from UTC + */ dcp::EncryptedKDM Film::make_kdm ( dcp::Certificate recipient, @@ -1184,12 +1188,15 @@ Film::make_kdm ( ).encrypt (signer, recipient, trusted_devices, formulation); } +/** @param from KDM from time expressed as a local time in the time zone of the Screen's Cinema. + * @param to KDM to time expressed as a local time in the time zone of the Screen's Cinema. + */ list<ScreenKDM> Film::make_kdms ( list<shared_ptr<Screen> > screens, boost::filesystem::path dcp, - dcp::LocalTime from, - dcp::LocalTime until, + boost::posix_time::ptime from, + boost::posix_time::ptime until, dcp::Formulation formulation ) const { @@ -1197,7 +1204,16 @@ Film::make_kdms ( BOOST_FOREACH (shared_ptr<Screen> i, screens) { if (i->recipient) { - kdms.push_back (ScreenKDM (i, make_kdm (i->recipient.get(), i->trusted_devices, dcp, from, until, formulation))); + dcp::EncryptedKDM const kdm = make_kdm ( + i->recipient.get(), + i->trusted_devices, + dcp, + dcp::LocalTime (from, i->cinema->utc_offset(), 0), + dcp::LocalTime (until, i->cinema->utc_offset(), 0), + formulation + ); + + kdms.push_back (ScreenKDM (i, kdm)); } } diff --git a/src/lib/film.h b/src/lib/film.h index b34e4bcfa..b8e31a420 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -132,8 +132,8 @@ public: std::list<ScreenKDM> make_kdms ( std::list<boost::shared_ptr<Screen> >, boost::filesystem::path cpl_file, - dcp::LocalTime from, - dcp::LocalTime until, + boost::posix_time::ptime from, + boost::posix_time::ptime until, dcp::Formulation formulation ) const; |
