ptsserv: add first pts64 check in. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Sat, 8 Jun 2019 03:45:51 +0000 (11:45 +0800)
committershihong.zheng <shihong.zheng@amlogic.com>
Sat, 8 Jun 2019 03:46:02 +0000 (11:46 +0800)
PD#OTT-4173

Problem:
video stuck after seek. first pts64 is
abnormal when lookup failed.

Solution:
add first pts64 checkin for lookup failed.

Verify:
w400

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

index a900579..7571ccb 100644 (file)
@@ -70,6 +70,7 @@ struct pts_table_s {
        unsigned long buf_start;
        u32 buf_size;
        int first_checkin_pts;
+       u64 first_checkin_pts_uS64;
        int first_lookup_ok;
        int first_lookup_is_fail;       /*1: first lookup fail;*/
                                           /*0: first lookup success */
@@ -444,25 +445,28 @@ static int pts_checkin_offset_inline(u8 type, u32 offset, u32 val, u64 uS64)
 
                if (type == PTS_TYPE_VIDEO && pTable->first_checkin_pts == -1) {
                        pTable->first_checkin_pts = val;
+                       pTable->first_checkin_pts_uS64 = uS64;
                        timestamp_checkin_firstvpts_set(val);
                        /*
                         *if(tsync_get_debug_pts_checkin() &&
                         * tsync_get_debug_vpts()) {
                         */
-                       pr_debug("first check in vpts <0x%x:0x%x> ok!\n",
-                                       offset,
-                                       val);
+                       pr_debug(
+                               "first check in vpts <0x%x:0x%x(0x%llx)> ok!\n",
+                               offset, val, uS64);
                        /* } */
                }
                if (type == PTS_TYPE_AUDIO && pTable->first_checkin_pts == -1) {
                        pTable->first_checkin_pts = val;
+                       pTable->first_checkin_pts_uS64 = uS64;
                        timestamp_checkin_firstapts_set(val);
                        /*
                         *if (tsync_get_debug_pts_checkin() &&
                         * tsync_get_debug_apts()) {
                         */
-                       pr_info("first check in apts <0x%x:0x%x> ok!\n", offset,
-                                       val);
+                       pr_info(
+                               "first check in apts <0x%x:0x%x(0x%llx)> ok!\n",
+                               offset, val, uS64);
                        /* } */
                }
 
@@ -928,7 +932,7 @@ static int pts_lookup_offset_inline_locked(u8 type, u32 offset, u32 *val,
                         */
                        if (!pTable->first_lookup_ok) {
                                *val = pTable->first_checkin_pts;
-                               *uS64 = (u64)(*val) << 32;
+                               *uS64 = pTable->first_checkin_pts_uS64;
                                pTable->first_lookup_ok = 1;
                                pTable->first_lookup_is_fail = 1;