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)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:18:02 +0000 (14:18 +0800)
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 c6fb4ab..d9b4cca 100644 (file)
@@ -756,10 +756,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,