From d1b4dbb793e2850d032ce3c91f0c91d045ae19dc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 16 Apr 2022 23:57:19 +0200 Subject: [PATCH] Replace encrypted content with black if we have no key (#2234). --- src/lib/content.h | 4 ++++ src/lib/dcp_content.h | 2 +- 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, 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 content) { - return static_cast(content->video) && content->video->use(); + return static_cast(content->video) && content->video->use() && content->can_be_played(); } -- 2.30.2