video: clear pcr in video stop [1/1]
authorshuanglong.wang <shuanglong.wang@amlogic.com>
Mon, 3 Jun 2019 01:56:30 +0000 (09:56 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 3 Jun 2019 09:45:20 +0000 (02:45 -0700)
PD#SWPL-6903

Problem:
pcr increase automatic after system reset

Solution:
in non-tunnel mode, only after video stop post will adjust pcr
in omx_secret_mode. Also clear pcr in video stop

Verify:
verify by nts

Change-Id: I528229e8121a99e50c7b8313bd8dc867e3710ad8
Signed-off-by: shuanglong.wang <shuanglong.wang@amlogic.com>
drivers/amlogic/media/frame_sync/tsync.c
drivers/amlogic/media/video_sink/video.c

index 9d0311e..7e2f691 100644 (file)
@@ -803,6 +803,7 @@ void tsync_avevent_locked(enum avevent_e event, u32 param)
        case VIDEO_STOP:
                tsync_stat = TSYNC_STAT_PCRSCR_SETUP_NONE;
                timestamp_vpts_set(0);
+               timestamp_pcrscr_set(0);
                timestamp_pcrscr_enable(0);
                timestamp_firstvpts_set(0);
                tsync_video_started = 0;
index 900fccf..c79b062 100644 (file)
@@ -6700,10 +6700,11 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                        }
                }
 
-               if ((diff - omx_pts_interval_upper) > 0
+               if (((diff - omx_pts_interval_upper) > 0
                        || (diff - omx_pts_interval_lower) < 0
                        || (omx_pts_set_from_hwc_count <
-                       OMX_MAX_COUNT_RESET_SYSTEMTIME)) {
+                       OMX_MAX_COUNT_RESET_SYSTEMTIME))
+                       && video_start_post) {
                        timestamp_pcrscr_enable(1);
                        if (debug_flag & DEBUG_FLAG_PTS_TRACE)
                                pr_info("system_time=%d, omx_pts=%d, diff=%d\n",
@@ -6715,7 +6716,8 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                } else if (((diff - omx_pts_interval_upper / 2) > 0
                        || (diff - omx_pts_interval_lower / 2) < 0)
                        && (omx_pts_set_from_hwc_count_begin <
-                       OMX_MAX_COUNT_RESET_SYSTEMTIME_BEGIN)) {
+                       OMX_MAX_COUNT_RESET_SYSTEMTIME_BEGIN)
+                       && video_start_post) {
                        timestamp_pcrscr_enable(1);
                        if (debug_flag & DEBUG_FLAG_PTS_TRACE)
                                pr_info("begin-system_time=%d, omx_pts=%d, diff=%d\n",
@@ -6723,7 +6725,8 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
                        timestamp_pcrscr_set(omx_pts + DURATION_GCD);
                } else if (is_dolby_vision_enable()
                        && ((diff - omx_pts_dv_upper) > 0
-                       || (diff - omx_pts_dv_lower) < 0)) {
+                       || (diff - omx_pts_dv_lower) < 0)
+                       && video_start_post) {
                        timestamp_pcrscr_set(omx_pts + DURATION_GCD);
                }
        } else