diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-07 00:39:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-07 00:39:15 +0100 |
| commit | 932b942a51bef4e2dd2de9f83aa5b68ad07f60f9 (patch) | |
| tree | 40f81e0b4b2e04f46bab243e9c94ff24b8bcb2ef /src/reel.cc | |
| parent | 4313456938d34d93239194e914b82e7a5ae14c1c (diff) | |
Working decryption via KDM.
Diffstat (limited to 'src/reel.cc')
| -rw-r--r-- | src/reel.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/reel.cc b/src/reel.cc index 4a266fda..c8ea54eb 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -23,8 +23,12 @@ #include "picture_asset.h" #include "sound_asset.h" #include "subtitle_asset.h" +#include "kdm.h" -using namespace std; +using std::string; +using std::list; +using std::cout; +using boost::shared_ptr; using namespace libdcp; void @@ -86,3 +90,17 @@ Reel::encrypted () const return ((_main_picture && _main_picture->encrypted ()) || (_main_sound && _main_sound->encrypted ())); } +void +Reel::add_kdm (KDM const & kdm) +{ + list<KDMCipher> ciphers = kdm.ciphers (); + + for (list<KDMCipher>::iterator i = ciphers.begin(); i != ciphers.end(); ++i) { + if (i->key_id() == _main_picture->key_id()) { + _main_picture->set_kdm_cipher (*i); + } + if (i->key_id() == _main_sound->key_id()) { + _main_sound->set_kdm_cipher (*i); + } + } +} |
