/* */
int i_frame_rate;
- int i_current_rate;
bool b_no_skip;
bool b_quiet;
memset( p_synchro->pi_meaningful, 0, 4 * sizeof(unsigned int) );
p_synchro->i_nb_ref = 0;
p_synchro->i_trash_nb_ref = p_synchro->i_dec_nb_ref = 0;
- p_synchro->current_pts = mdate() + DEFAULT_PTS_DELAY;
+ p_synchro->current_pts = 1,
p_synchro->backward_pts = 0;
p_synchro->i_current_period = p_synchro->i_backward_period = 0;
p_synchro->i_trashed_pic = p_synchro->i_not_chosen_pic =
mtime_t now, period;
mtime_t pts = 0;
bool b_decode = 0;
+ int i_current_rate;
if ( p_synchro->b_no_skip )
return 1;
+ i_current_rate = decoder_GetDisplayRate( p_synchro->p_dec );
+
now = mdate();
period = 1000000 * 1001 / p_synchro->i_frame_rate
- * p_synchro->i_current_rate / INPUT_RATE_DEFAULT;
+ * i_current_rate / INPUT_RATE_DEFAULT;
p_synchro->i_render_time = i_render_time;
case I_CODING_TYPE:
if( b_low_delay )
{
- pts = S.current_pts;
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.current_pts );
}
else if( S.backward_pts )
{
- pts = S.backward_pts;
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.backward_pts );
}
else
{
* | +- current picture
* +- current PTS
*/
- pts = S.current_pts + period * (S.i_n_b + 2);
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.current_pts ) + period * (S.i_n_b + 2);
}
if( (1 + S.i_n_p * (S.i_n_b + 1)) * period >
case P_CODING_TYPE:
if( b_low_delay )
{
- pts = S.current_pts;
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.current_pts );
}
else if( S.backward_pts )
{
- pts = S.backward_pts;
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.backward_pts );
}
else
{
- pts = S.current_pts + period * (S.i_n_b + 1);
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.current_pts + period * (S.i_n_b + 1) );
}
if( p_synchro->i_nb_ref < 1 )
break;
case B_CODING_TYPE:
- pts = S.current_pts;
+ pts = decoder_GetDisplayDate( p_synchro->p_dec, S.current_pts );
if( p_synchro->i_nb_ref < 2 )
{
* decoder_SynchroNewPicture: Update stream structure and PTS
*****************************************************************************/
void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type,
- int i_repeat_field, mtime_t next_pts,
- mtime_t next_dts, int i_current_rate,
- bool b_low_delay )
+ int i_repeat_field, mtime_t next_pts,
+ mtime_t next_dts, bool b_low_delay )
{
- mtime_t period = 1000000 * 1001 / p_synchro->i_frame_rate
- * i_current_rate / INPUT_RATE_DEFAULT;
+ mtime_t period = 1000000 * 1001 / p_synchro->i_frame_rate;
#if 0
mtime_t now = mdate();
#endif
- p_synchro->i_current_rate = i_current_rate;
switch( i_coding_type )
{