tsync: reduce the log information [1/1]
authorXiaoming Sui <xiaoming.sui@amlogic.com>
Tue, 26 Mar 2019 14:06:04 +0000 (22:06 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:17:58 +0000 (14:17 +0800)
PD#SWPL-6152

Problem:
in some special cases, there are many sync
log information from serial port.

Solution:
remove this log and add pts realign.

Verify:
X301

Change-Id: I81d1753ef6d4e6c1e39d6c7f38eb3836e07be05d
Signed-off-by: Xiaoming Sui <xiaoming.sui@amlogic.com>
drivers/amlogic/media/frame_sync/tsync.c

index 1c7d623..98192bf 100644 (file)
@@ -1211,13 +1211,14 @@ int tsync_set_apts(unsigned int pts)
        else
                t = timestamp_pcrscr_get();
        if (tsdemux_pcrscr_valid_cb && tsdemux_pcrscr_valid_cb() == 1) {
-               pr_info("tsync_set_apts %x,diff %d\n",
-                       pts, (int)timestamp_pcrscr_get() - pts);
                timestamp_apts_set(pts);
-               if ((int)(timestamp_apts_get() - t) > 30 * TIME_UNIT90K / 1000
-                               || (int)(t - timestamp_apts_get()) >
-                               80 * TIME_UNIT90K / 1000)
+               if ((int)(timestamp_apts_get() - timestamp_pcrscr_get())
+                       > 30 * TIME_UNIT90K / 1000
+                       || (int)(timestamp_pcrscr_get() - timestamp_apts_get())
+                       > 80 * TIME_UNIT90K / 1000) {
                        timestamp_pcrscr_set(pts);
+                       set_pts_realign();
+               }
                return 0;
        }
        /* do not switch tsync mode until first video toggled. */