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)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:42:48 +0000 (14:42 +0800)
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 5744664..64fc464 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 d81845c..29f0bc6 100644 (file)
@@ -6368,10 +6368,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",
@@ -6383,7 +6384,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",
@@ -6391,7 +6393,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