Replace encrypted content with black if we have no key (#2234).
authorCarl Hetherington <cth@carlh.net>
Sat, 16 Apr 2022 21:57:19 +0000 (23:57 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 20 Apr 2022 20:10:11 +0000 (22:10 +0200)
src/lib/content.h
src/lib/dcp_content.h
src/lib/player.cc

index 7fad2ff792f7ea0823d7f68f542298eba87db6a0..7c02ee0e39effc323216cfc28d29da07ea63d236 100644 (file)
@@ -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;
 
index d57c0059c753cdf621d1e9d11c7dbac02b25d82b..55773b94439217540bc9ea5a916527e7a96cd388 100644 (file)
@@ -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;
 
index 12a53bc63c712865690fac123174610e31110bae..58ea4f2dea660ac6db81c51fbe55767573661c20 100644 (file)
@@ -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();
 }