From b7da1a0d3647489319b08f2d2109f61ffb51bd9b Mon Sep 17 00:00:00 2001 From: rongrong zhou Date: Wed, 6 Mar 2019 17:59:28 +0800 Subject: [PATCH] ptsserv: fix pts lookup fail issue [3/3] PD#SWPL-3730 Problem: playback not smooth Solution: if p2 lookup fail, set p2 = p Verify: verified by x301 Change-Id: I181eae2ba40edd937df12e0925c2a55c856162ba Signed-off-by: rongrong zhou --- drivers/amlogic/media/frame_sync/ptsserv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/amlogic/media/frame_sync/ptsserv.c b/drivers/amlogic/media/frame_sync/ptsserv.c index dde139f..82e1213 100644 --- a/drivers/amlogic/media/frame_sync/ptsserv.c +++ b/drivers/amlogic/media/frame_sync/ptsserv.c @@ -752,6 +752,11 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val, p2 = p; } + /* if p2 lookup fail, set p2 = p */ + if (type == PTS_TYPE_VIDEO && p2 && p && + OFFSET_DIFF(offset, p2->offset) > lookup_threshold && + OFFSET_DIFF(offset, p->offset) < lookup_threshold) + p2 = p; } else if (OFFSET_LATER(p->offset, offset)) { list_for_each_entry_continue_reverse(p, &pTable-> -- 2.7.4