avsync: av not sync problem cased by vp9 trig

PD#161895: av not sync problem cased by vp9 trig

1)vp9 initialization stream do not post VIDEO_START event,
so do not post VIDEO_STOP in unregister when not post
VIDEO_START which occured in vp9 tirg reset codec operation.
2)AV audio master adjust pcr according apts diff in
tsync tsync_set_apts need to reopen which was commented in
the begining tree of 4.9 codec
3)summit as Tim's patch

Change-Id: I9fb62aecb27f75d1ea9dff938452e0dd4f11b901
Signed-off-by: shuanglong.wang <shuanglong.wang@amlogic.com>
This commit is contained in:
shuanglong.wang
2018-05-14 16:33:49 +08:00
committed by Yixun Lan
parent 3305a0c5cb
commit 5ab25fe0db
2 changed files with 13 additions and 6 deletions

View File

@@ -1058,7 +1058,7 @@ int tsync_set_apts(unsigned int pts)
unsigned int t;
/* ssize_t r; */
unsigned int oldpts = timestamp_apts_get();
/*int oldmod = tsync_mode;*/
int oldmod = tsync_mode;
if (tsync_abreak)
tsync_abreak = 0;
@@ -1084,7 +1084,7 @@ int tsync_set_apts(unsigned int pts)
if (tsync_mode == TSYNC_MODE_AMASTER)
t = timestamp_pcrscr_get();
#if 0//DEBUG_TMP
if (tsync_mode == TSYNC_MODE_AMASTER) {
/* special used for Dobly Certification AVSync test */
if (dobly_avsync_test) {
@@ -1133,7 +1133,7 @@ int tsync_set_apts(unsigned int pts)
}
} else if (oldmod != tsync_mode && tsync_mode == TSYNC_MODE_VMASTER)
timestamp_pcrscr_set(timestamp_vpts_get());
#endif
return 0;
}
EXPORT_SYMBOL(tsync_set_apts);

View File

@@ -131,6 +131,7 @@ static int receive_frame_count;
static int display_frame_count;
static int omx_need_drop_frame_num;
static bool omx_drop_done;
static bool video_start_post;
/*----omx_info bit0: keep_last_frame, bit1~31: unused----*/
static u32 omx_info = 0x1;
@@ -4655,10 +4656,12 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
vf = video_vf_peek();
if (vf) {
if (hdmi_in_onvideo == 0)
if (hdmi_in_onvideo == 0) {
tsync_avevent_locked(VIDEO_START,
(vf->pts) ? vf->pts :
timestamp_vpts_get());
video_start_post = true;
}
if (show_first_frame_nosync || show_first_picture)
show_nosync = true;
@@ -6043,14 +6046,18 @@ static void video_vf_unreg_provider(void)
/* TODO: mod gate */
/* switch_mod_gate_by_name("ge2d", 0); */
}
if (hdmi_in_onvideo == 0)
if ((hdmi_in_onvideo == 0) && (video_start_post)) {
tsync_avevent(VIDEO_STOP, 0);
video_start_post = false;
}
#else
/* if (!trickmode_fffb) */
if (cur_dispbuf)
keeped = vf_keep_current(cur_dispbuf, el_vf);
if (hdmi_in_onvideo == 0)
if ((hdmi_in_onvideo == 0) && (video_start_post)) {
tsync_avevent(VIDEO_STOP, 0);
video_start_post = false;
}
#endif
if (keeped < 0) {/*keep failed.*/
pr_info("video keep failed, disable video now!\n");