pts: fix mvc play is not smooth. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Tue, 26 Mar 2019 10:40:27 +0000 (18:40 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 27 Mar 2019 06:16:39 +0000 (23:16 -0700)
PD#SWPL-6094

Problem:
some mvc stream is not smooth.

Solution:
optimize the condition for pts loockup fail code.

Verify:
x301

Change-Id: I50bb3f317e1245735f9ce0ffcc44376c91e871ed
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/amlogic/media/frame_sync/ptsserv.c

index 82e1213..0930068 100644 (file)
@@ -752,10 +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)
+                       abs(OFFSET_DIFF(offset, p->offset)) < lookup_threshold)
                                p2 = p;
                } else if (OFFSET_LATER(p->offset, offset)) {
                        list_for_each_entry_continue_reverse(p,