OSDN Git Service

SetProtected: fix logic error
authorLin Johnson <johnson.lin@intel.com>
Wed, 14 Nov 2018 08:29:46 +0000 (16:29 +0800)
committerKelly Ledford <kelly.ledford@intel.com>
Thu, 15 Nov 2018 21:59:27 +0000 (13:59 -0800)
Should only allow video and protected layer switch

Change-Id: I4633725277e0cee125c24b33a42fcd481f9f5990
Tracked-On: None
Tests: Video playback on Android
Signed-off-by: Lin Johnson <johnson.lin@intel.com>
common/core/overlaylayer.h

index 20efcf2..bb6b95b 100644 (file)
@@ -185,9 +185,9 @@ struct OverlayLayer {
   }
 
   void SetProtected(bool isProtected) {
-    if (isProtected && type_ == kLayerVideo)
+    if (isProtected && (type_ == kLayerVideo || type_ == kLayerProtected))
       type_ = kLayerProtected;
-    else if (!isProtected && type_ == kLayerProtected)
+    else if (!isProtected && (type_ == kLayerProtected || type_ == kLayerVideo))
       type_ = kLayerVideo;
     else
       type_ = kLayerNormal;