/* PTS management */
if( p_pes->b_has_pts )
{
+ //intf_Msg("%lld\n", p_pes->i_pts);
switch( p_es->p_pgrm->i_synchro_state )
{
case SYNCHRO_NOT_STARTED:
- p_pes->b_has_pts = 0;
- break;
-
case SYNCHRO_START:
- p_pes->i_pts += p_es->p_pgrm->delta_cr;
- p_es->p_pgrm->delta_absolute = mdate()
- - p_pes->i_pts + DEFAULT_PTS_DELAY;
- p_pes->i_pts += p_es->p_pgrm->delta_absolute;
- p_es->p_pgrm->i_synchro_state = SYNCHRO_OK;
+ p_pes->b_has_pts = 0;
break;
case SYNCHRO_REINIT: /* We skip a PES | Why ?? --Meuuh */
case SYNCHRO_OK:
p_pes->i_pts += p_es->p_pgrm->delta_cr
- + p_es->p_pgrm->delta_absolute;
+ + p_es->p_pgrm->delta_absolute
+ + DEFAULT_PTS_DELAY;
break;
}
}
p_pgrm = p_input->stream.pp_programs[0];
}
- if( p_input->stream.b_pace_control )
+ if( p_pgrm->i_synchro_state != SYNCHRO_OK )
+ {
+ switch( p_pgrm->i_synchro_state )
+ {
+ case SYNCHRO_START:
+ p_pgrm->delta_absolute = mdate() - cr_time;
+ p_pgrm->i_synchro_state = SYNCHRO_OK;
+ break;
+
+ default:
+ break;
+ }
+ }
+ else if( p_input->stream.b_pace_control )
{
/* Wait a while before delivering the packets to the decoder. */
mwait( cr_time + p_pgrm->delta_absolute );
switch( i_code )
{
case 0x1BA: /* PACK_START_CODE */
- if( p_input->stream.pp_programs[0]->i_synchro_state == SYNCHRO_OK )
{
/* Convert the SCR in microseconds. */
mtime_t scr_time;
) * 300) / 27;
}
/* Call the pace control. */
- CRDecode( p_input, NULL, scr_time );
+ //intf_Msg("+%lld\n", scr_time);
+ CRDecode( p_input, NULL, scr_time - 200000 );
+ b_trash = 1;
}
- b_trash = 1;
break;
case 0x1BB: /* SYSTEM_START_CODE */