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 <yingwei.long@amlogic.com>
This commit is contained in:
Yingwei Long
2019-02-28 20:01:24 +08:00
committed by Luan Yuan
parent af9cad4fbe
commit 636c60fcba

View File

@@ -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 */