X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=e669ea4ae434a2f8d08cdbb0b0aca78370d9f86e;hb=bdae32bb84672026c1a373e809804109e95accf4;hp=3ea7545dfcb2fe3661a40e9fbd762c7d1a9b3a33;hpb=e1ec5b2c81ec2e15d4c1d97cce8252fa34c7116a;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index 3ea7545df..e669ea4ae 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington 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 #include #include @@ -1032,7 +1033,7 @@ Film::maybe_add_content (weak_ptr j, weak_ptr c) } add_content (content); - if (Config::instance()->automatic_audio_analysis ()) { + if (Config::instance()->automatic_audio_analysis() && dynamic_pointer_cast (content)) { shared_ptr playlist (new Playlist); playlist->add (content); boost::signals2::connection c; @@ -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 Film::make_kdms ( list > 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 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)); } }