diff options
| author | Mart Jansink <mart@gofilex.nl> | 2018-02-12 22:01:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-02-14 23:28:26 +0000 |
| commit | 6c2ce9462ba0e0159846554a709ea1838ad7ca08 (patch) | |
| tree | fced5c8cd0dc33075da5a0e1b8cf7c843d658ceb /src/tools/dcpomatic_kdm_cli.cc | |
| parent | 9470bc50aa948677fabb201824acac518bbe7f96 (diff) | |
Correctly handle multiple cinemas and multiple screens per cinema.
Diffstat (limited to 'src/tools/dcpomatic_kdm_cli.cc')
| -rw-r--r-- | src/tools/dcpomatic_kdm_cli.cc | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index fe83e9e41..4b7a35f7e 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -322,6 +322,7 @@ from_dkdm ( if (!i->recipient) { continue; } + screen_kdms.push_back ( ScreenKDM ( i, @@ -380,7 +381,6 @@ int main (int argc, char* argv[]) string screen_description = ""; list<shared_ptr<Screen> > screens; optional<dcp::Certificate> certificate; - vector<dcp::Certificate> trusted_devices; optional<dcp::EncryptedKDM> dkdm; optional<boost::posix_time::ptime> valid_from; optional<boost::posix_time::ptime> valid_to; @@ -463,29 +463,24 @@ int main (int argc, char* argv[]) verbose = true; break; case 'c': - if (certificate) { - shared_ptr<Screen> screen (new Screen (screen_description, certificate, trusted_devices)); - if (cinema_name) { - cinema->add_screen (screen); - } - screens.push_back (screen); - - certificate = boost::none; - screen_description = ""; - trusted_devices = vector<dcp::Certificate> (); - } - cinema_name = optarg; cinema = shared_ptr<Cinema> (new Cinema (optarg, list<string> (), "", 0, 0 )); break; case 'S': screen_description = optarg; break; - case 'C': + case 'C': { certificate = dcp::Certificate (dcp::file_to_string (optarg)); + vector<dcp::Certificate> trusted_devices; + shared_ptr<Screen> screen (new Screen (screen_description, certificate, trusted_devices)); + if (cinema_name) { + cinema->add_screen (screen); + } + screens.push_back (screen); break; + } case 'T': - trusted_devices.push_back (dcp::Certificate (dcp::file_to_string (optarg))); + screens.back()->trusted_devices.push_back (dcp::Certificate (dcp::file_to_string (optarg))); break; case 'B': list_cinemas = true; @@ -509,14 +504,6 @@ int main (int argc, char* argv[]) exit (EXIT_SUCCESS); } - if (certificate) { - shared_ptr<Screen> screen (new Screen (screen_description, certificate, trusted_devices)); - if (cinema_name) { - cinema->add_screen (screen); - } - screens.push_back (screen); - } - if (!duration_string && !valid_to) { error ("you must specify a --valid-duration or --valid-to"); } |
