cl->last_cr = 0;
cl->last_pts = 0;
+ cl->last_sysdate = 0;
cl->cr_ref = 0;
cl->sysdate_ref = 0;
cl->delta_cr = 0;
else
{
cl->last_cr = 0;
+ cl->last_sysdate = 0;
cl->delta_cr = 0;
cl->i_delta_cr_residue = 0;
}
}
else
{
+ mtime_t clock_max_gap = CR_MAX_GAP * 90 / p_input->i_rate;
if ( cl->last_cr != 0 &&
- ( (cl->last_cr - i_clock) > CR_MAX_GAP
- || (cl->last_cr - i_clock) < - CR_MAX_GAP ) )
+ ( (cl->last_cr - i_clock) > clock_max_gap
+ || (cl->last_cr - i_clock) < - clock_max_gap ) )
{
/* Stream discontinuity, for which we haven't received a
* warning from the stream control facilities (dd-edited
input_ClockManageControl( p_input, cl, i_clock );
#endif
}
- else
+ else if ( mdate() - cl->last_sysdate > 200000 )
{
/* Smooth clock reference variations. */
mtime_t i_extrapoled_clock = ClockCurrent( p_input, cl );
+ cl->i_delta_cr_residue )
% cl->i_cr_average;
cl->delta_cr = delta_cr;
+ cl->last_sysdate = mdate();
}
}
}