tsync: reduce the log information [1/1]
authorXiaoming Sui <xiaoming.sui@amlogic.com>
Tue, 26 Mar 2019 14:06:04 +0000 (22:06 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Thu, 28 Mar 2019 09:10:43 +0000 (02:10 -0700)
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 27fb17d..b18a048 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. */