From c01fd6a29b4ac31c5484440809d0726a9651fde2 Mon Sep 17 00:00:00 2001 From: Yao.Liu Date: Tue, 05 Dec 2017 02:21:23 +0000 Subject: hwc2: setvideodisable to 1 to free last video frame PD#156059 PD#156062 Some apps close video surfaceview before decoding finished, last few video frames will continue to display if videodisable=2 Change-Id: I200c3aea25da3eb55eabe4ce00591cac3d6defe8 Signed-off-by: Yao.Liu --- diff --git a/hwc2/common/devices/PhysicalDevice.cpp b/hwc2/common/devices/PhysicalDevice.cpp index bc75be2..338b83a 100644 --- a/hwc2/common/devices/PhysicalDevice.cpp +++ b/hwc2/common/devices/PhysicalDevice.cpp @@ -1432,10 +1432,10 @@ int32_t PhysicalDevice::validateDisplay(uint32_t* outNumTypes, } else { //disable video layer. if (mVideoLayerOpenByOMX) { - if (is_disable_video == 0) { + if (is_disable_video == 0 || is_disable_video == 2) { if (mVideoOverlayLayerId == 0) { - ALOGI("no omx video layer, no OVERLAY, set display_mode 2"); - AmVideo::getInstance()->setvideodisable(2); + ALOGI("no omx video layer, no OVERLAY, set display_mode %d->1",is_disable_video); + AmVideo::getInstance()->setvideodisable(1); } else { ALOGI("no omx video layer, but has OVERLAY, not set display_mode"); } -- cgit