From 636c60fcba29504a04abf780b026469c2278e671 Mon Sep 17 00:00:00 2001 From: Yingwei Long Date: Thu, 28 Feb 2019 20:01:24 +0800 Subject: [PATCH] tsync: do not operate tsync_mode_switch before first video toggled [1/1] PD#SWPL-5131 Problem: Some stream in tunnel mode, first audio pts is large than AV_DISCONTINUE_THREDHOLD_MAX(60s). In audio_hw it will check pcr and apts diff, so large difference between pcr and apts will lead sync mode from amster to vmaster(egg:SYNC-HEVC-59FPS-DDP51) Solution: do not operate tsync_mode_switch before first video toggled Verify: verify by franklin Change-Id: Icec2de71ea8f838146444aa3ea880f76ed8e0f13 Signed-off-by: Yingwei Long --- drivers/amlogic/media/frame_sync/tsync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media/frame_sync/tsync.c b/drivers/amlogic/media/frame_sync/tsync.c index df091fe34171..2b41eb182cbf 100644 --- a/drivers/amlogic/media/frame_sync/tsync.c +++ b/drivers/amlogic/media/frame_sync/tsync.c @@ -1155,8 +1155,9 @@ int tsync_set_apts(unsigned int pts) t = timestamp_vpts_get(); else t = timestamp_pcrscr_get(); + /* do not switch tsync mode until first video toggled. */ if ((abs(oldpts - pts) > tsync_av_threshold_min) && - (!get_vsync_pts_inc_mode())) { /* is discontinue */ + (timestamp_firstvpts_get() > 0)) { /* is discontinue */ apts_discontinue = 1; tsync_mode_switch('A', abs(pts - t), pts - oldpts); /*if in VMASTER ,just wait */