*****************************************************************************/
decoder_synchro_t * decoder_SynchroInit( decoder_t *p_dec, int i_frame_rate )
{
*****************************************************************************/
decoder_synchro_t * decoder_SynchroInit( decoder_t *p_dec, int i_frame_rate )
{
- decoder_synchro_t * p_synchro = malloc( sizeof(*p_synchro) );
- if ( p_synchro == NULL )
- {
- msg_Err( p_dec, "out of memory" );
+ decoder_synchro_t * p_synchro = calloc( 1, sizeof(*p_synchro) );
+ if( !p_synchro )
- p_synchro->b_no_skip = !config_GetInt( p_dec, "skip-frames" );
- p_synchro->b_quiet = config_GetInt( p_dec, "quiet-synchro" );
+ p_synchro->b_no_skip = !var_InheritBool( p_dec, "skip-frames" );
+ p_synchro->b_quiet = var_InheritBool( p_dec, "quiet-synchro" );
/* We use a fake stream pattern, which is often right. */
p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
/* We use a fake stream pattern, which is often right. */
p_synchro->i_n_p = p_synchro->i_eta_p = DEFAULT_NB_P;
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;
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->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 =
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 =
if( !b_decode && !p_synchro->b_quiet )
{
msg_Warn( p_synchro->p_dec,
if( !b_decode && !p_synchro->b_quiet )
{
msg_Warn( p_synchro->p_dec,
* decoder_SynchroNewPicture: Update stream structure and PTS
*****************************************************************************/
void decoder_SynchroNewPicture( decoder_synchro_t * p_synchro, int i_coding_type,
* 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 )
- msg_Dbg( p_synchro->p_dec, "I("I64Fd") P("I64Fd")[%d] B("I64Fd")"
- "[%d] YUV("I64Fd") : trashed %d:%d/%d",
+ msg_Dbg( p_synchro->p_dec, "I(%"PRId64") P(%"PRId64")[%d] B(%"PRId64")"
+ "[%d] YUV(%"PRId64") : trashed %d:%d/%d",
p_synchro->p_tau[I_CODING_TYPE],
p_synchro->p_tau[P_CODING_TYPE],
p_synchro->i_n_p,
p_synchro->p_tau[I_CODING_TYPE],
p_synchro->p_tau[P_CODING_TYPE],
p_synchro->i_n_p,
> PTS_THRESHOLD) && !p_synchro->b_quiet )
{
msg_Warn( p_synchro->p_dec, "decoder synchro warning: pts != "
> PTS_THRESHOLD) && !p_synchro->b_quiet )
{
msg_Warn( p_synchro->p_dec, "decoder synchro warning: pts != "
> PTS_THRESHOLD) && !p_synchro->b_quiet )
{
msg_Warn( p_synchro->p_dec,
> PTS_THRESHOLD) && !p_synchro->b_quiet )
{
msg_Warn( p_synchro->p_dec,
/* We cannot be _that_ late, something must have happened, reinit
* the dates. */
if( !p_synchro->b_quiet )
/* We cannot be _that_ late, something must have happened, reinit
* the dates. */
if( !p_synchro->b_quiet )
- msg_Warn( p_synchro->p_dec, "PTS << now ("I64Fd"), resetting",
+ msg_Warn( p_synchro->p_dec, "PTS << now (%"PRId64"), resetting",
now - p_synchro->current_pts - DEFAULT_PTS_DELAY );
p_synchro->current_pts = now + DEFAULT_PTS_DELAY;
}
now - p_synchro->current_pts - DEFAULT_PTS_DELAY );
p_synchro->current_pts = now + DEFAULT_PTS_DELAY;
}