{
if (system_time_up) {
#ifdef MODIFY_TIMESTAMP_INC_WITH_PLL
- inc = inc * timestamp_inc_factor / PLL_FACTOR;
+ inc = inc * (s32)timestamp_inc_factor / PLL_FACTOR;
#endif
system_time += inc + system_time_inc_adj;
ATRACE_COUNTER("PCRSCR", system_time);
("%c-discontinue,pcr=%d,vpts=%d,apts=%d,diff_pts=%lu,jump_Pts=%d\n",
mode, timestamp_pcrscr_get(), timestamp_vpts_get(),
timestamp_apts_get(), diff_pts, jump_pts);
- if (!tsync_enable) {
+ if (!tsync_enable || !timestamp_apts_started()) {
if (tsync_mode != TSYNC_MODE_VMASTER)
tsync_mode = TSYNC_MODE_VMASTER;
tsync_av_mode = TSYNC_STATE_S;
static void tsync_state_switch_timer_fun(unsigned long arg)
{
- if (!vpause_flag && !apause_flag) {
+ if (!vpause_flag && !apause_flag && timestamp_apts_started()) {
if (tsync_av_mode == TSYNC_STATE_D
|| tsync_av_mode == TSYNC_STATE_A) {
if (tsync_av_dynamic_timeout_ms < jiffies_ms) {
case VIDEO_TSTAMP_DISCONTINUITY: {
unsigned int oldpts = timestamp_vpts_get();
int oldmod = tsync_mode;
- if (tsync_mode == TSYNC_MODE_VMASTER)
+ if (tsync_mode == TSYNC_MODE_VMASTER &&
+ timestamp_apts_started())
t = timestamp_apts_get();
else
t = timestamp_pcrscr_get();
/*debug info for skip & repeate vframe case*/
if (!vf) {
underflow++;
+ /* video master mode, reduce pcrscr */
+ if (tsync_get_mode() == TSYNC_MODE_VMASTER) {
+ s32 pts_inc = 0 - vsync_pts_inc;
+
+ timestamp_pcrscr_inc(pts_inc);
+ }
ATRACE_COUNTER("underflow", 1);
if (video_dbg_vf&(1<<0))
dump_vframe_status("vdin0");