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 <shuanglong.wang@amlogic.com>
This commit is contained in:
shuanglong.wang
2019-04-25 15:37:38 +08:00
committed by Luan Yuan
parent 05b61dc375
commit 32ed0e46f7

View File

@@ -6280,12 +6280,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