summaryrefslogtreecommitdiff
path: root/src/dcp.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-19 00:32:53 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-19 00:32:53 +0100
commit1f284533185a798c0ed36669bd6c9729adf6ec5a (patch)
tree94dd3de07e0670f1bf1eed0de94ada1033ceb7f6 /src/dcp.cc
parent37631b4d5e07eddbf052c1cff315d6a98b3bcb73 (diff)
Rename encrypted() to any_encrypted() and add all_encrypted().
Diffstat (limited to 'src/dcp.cc')
-rw-r--r--src/dcp.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index ca7313a5..ee1a64ed 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -316,11 +316,12 @@ DCP::add (std::shared_ptr<CPL> cpl)
_cpls.push_back (cpl);
}
+
bool
-DCP::encrypted () const
+DCP::any_encrypted () const
{
for (auto i: cpls()) {
- if (i->encrypted()) {
+ if (i->any_encrypted()) {
return true;
}
}
@@ -328,6 +329,20 @@ DCP::encrypted () const
return false;
}
+
+bool
+DCP::all_encrypted () const
+{
+ for (auto i: cpls()) {
+ if (!i->all_encrypted()) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
/** Add a KDM to decrypt this DCP. This method must be called after DCP::read()
* or the KDM you specify will be ignored.
* @param kdm KDM to use.