From 4a5e2dbc5aed1d800e5266f37d36aa7e4a1958ba Mon Sep 17 00:00:00 2001 From: "shuanglong.wang" Date: Thu, 25 Apr 2019 15:37:38 +0800 Subject: [PATCH] video: do not compensation when paused [1/1] PD#SWPL-5664 Problem: pcr not paused when netflix video non-tunnel mode pause Solution: do not compensation when diff between omxpts and pcr too large Because when paused, continous compensation will lead diff beween omxpts and pcr will alway inside pcr adjust threshold, and pcr not set again, then pcr will increase Verify: verify by nts Change-Id: Ib2acea35758d161d1e9db53dd6ff369ba7973351 Signed-off-by: shuanglong.wang --- drivers/amlogic/media/video_sink/video.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c index a707054..394be7c 100644 --- a/drivers/amlogic/media/video_sink/video.c +++ b/drivers/amlogic/media/video_sink/video.c @@ -6550,12 +6550,26 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id) diff = system_time - omx_pts; if (time_setomxpts.tv_sec > 0) { struct timeval now; - + /* time_setomxpts record hwc setomxpts time, */ + /* when check diff between pcr and omx_pts, */ + /* add compensation will let omx_pts and pcr */ + /* is at the some time, more accurate. Also */ + /* remove the compensation when omx_pts */ + /* is not update for a while, in case when */ + /* paused, pcr is not paused */ do_gettimeofday(&now); delta1 = (now.tv_sec - time_setomxpts.tv_sec) * 1000000LL + (now.tv_usec - time_setomxpts.tv_usec); - diff -= delta1 * 90 / 1000; + if (((diff - omx_pts_interval_upper * 3 / 2) > 0) + || ((diff - omx_pts_interval_lower * 3 / 2) + < 0)) { + time_setomxpts.tv_sec = 0; + time_setomxpts.tv_usec = 0; + pr_info("omxpts is not update for a while,do not need compenstate\n"); + } else { + diff -= delta1 * 90 / 1000; + } } if ((diff - omx_pts_interval_upper) > 0 -- 2.7.4