From 680f36f4e685ef28c16ddadb10de9d10a4bbdf98 Mon Sep 17 00:00:00 2001 From: "live.li" Date: Sun, 5 May 2019 15:41:24 +0800 Subject: [PATCH] avsync: tsync: change the start condition [2/2] PD#TV-5393 Problem: when pcr and vpts distance is far, use the vpts as system time for cache video to avoid video underrun solution: use vpts as system time for some special ts stream Verify: x301 Change-Id: I2f151c526bb0113d4f0cf8bbd1a4772312857606 Signed-off-by: live.li --- drivers/amlogic/media/frame_sync/tsync_pcr.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/amlogic/media/frame_sync/tsync_pcr.c b/drivers/amlogic/media/frame_sync/tsync_pcr.c index 7c51001..7e37390 100644 --- a/drivers/amlogic/media/frame_sync/tsync_pcr.c +++ b/drivers/amlogic/media/frame_sync/tsync_pcr.c @@ -389,15 +389,16 @@ void tsync_pcr_pcrscr_set(void) } } else { ref_pcr = timestamp_pcrscr_get(); + ref_pcr = timestamp_pcrscr_get(); + if (cur_pcr > min_checkinpts) { + ref_pcr = min_checkinpts - + tsync_pcr_ref_latency; + timestamp_pcrscr_set(ref_pcr); + timestamp_pcrscr_enable(1); + tsync_use_demux_pcr = 0; + } else { tsync_use_demux_pcr = 1; - if ((tsync_pcr_debug&0x01) && tsdemux_pcrscr_get_cb) { - pr_info("use the pcr from stream , the cur demux pcr is %x\n", - tsdemux_pcrscr_get_cb()); - pr_info("the timestamp pcr is %x\n", - timestamp_pcrscr_get()); - pr_info("the timestamp video pts is %x\n", - timestamp_firstvpts_get()); - } + } } init_check_first_systemtime = ref_pcr; -- 2.7.4