diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-04-16 23:57:19 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-04-20 22:10:11 +0200 |
| commit | d1b4dbb793e2850d032ce3c91f0c91d045ae19dc (patch) | |
| tree | ccf98662a1da3b9fd280b3f44230a569d4277f0c | |
| parent | 471dee40c1476aba2ff0cff7a57b31306c50b93e (diff) | |
Replace encrypted content with black if we have no key (#2234).
| -rw-r--r-- | src/lib/content.h | 4 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 2 | ||||
| -rw-r--r-- | src/lib/player.cc | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/content.h b/src/lib/content.h index 7fad2ff79..7c02ee0e3 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -192,6 +192,10 @@ public: std::string calculate_digest () const; + virtual bool can_be_played () const { + return true; + } + /* ChangeType::PENDING and ChangeType::CANCELLED may be emitted from any thread; ChangeType::DONE always from GUI thread */ boost::signals2::signal<void (ChangeType, std::weak_ptr<Content>, int, bool)> Change; diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index d57c0059c..55773b944 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -92,7 +92,7 @@ public: return _kdm; } - bool can_be_played () const; + bool can_be_played () const override; bool needs_kdm () const; bool needs_assets () const; diff --git a/src/lib/player.cc b/src/lib/player.cc index 12a53bc63..58ea4f2de 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -147,7 +147,7 @@ Player::setup_pieces () bool have_video (shared_ptr<const Content> content) { - return static_cast<bool>(content->video) && content->video->use(); + return static_cast<bool>(content->video) && content->video->use() && content->can_be_played(); } |
