- vout_SynchroNewPicture( p_dec->p_synchro,
- p_dec->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
- p_dec->p_info->current_picture->nb_fields,
- (p_dec->p_info->current_picture->flags & PIC_FLAG_PTS) ?
- ( (p_dec->p_info->current_picture->pts ==
- (uint32_t)p_dec->i_current_pts) ?
- p_dec->i_current_pts : p_dec->i_previous_pts ) : 0,
- 0,
- p_dec->i_current_rate );
-
- if ( !vout_SynchroChoose( p_dec->p_synchro,
- p_dec->p_info->current_picture->flags & PIC_MASK_CODING_TYPE ) )
+ if ( p_sys->b_after_sequence_header
+ && ((p_sys->p_info->current_picture->flags
+ & PIC_MASK_CODING_TYPE)
+ == PIC_FLAG_CODING_TYPE_P) )
+ {
+ /* Intra-slice refresh. Simulate a blank I picture. */
+ msg_Dbg( p_dec, "intra-slice refresh stream" );
+ vout_SynchroNewPicture( p_sys->p_synchro,
+ I_CODING_TYPE, 2, 0, 0, p_sys->i_current_rate );
+ vout_SynchroDecode( p_sys->p_synchro );
+ vout_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
+ p_sys->b_slice_i = 1;
+ }
+ p_sys->b_after_sequence_header = 0;
+
+ vout_SynchroNewPicture( p_sys->p_synchro,
+ p_sys->p_info->current_picture->flags & PIC_MASK_CODING_TYPE,
+ p_sys->p_info->current_picture->nb_fields,
+ (p_sys->p_info->current_picture->flags & PIC_FLAG_PTS) ?
+ ( ( p_sys->p_info->current_picture->pts ==
+ (uint32_t)p_sys->i_current_pts ) ?
+ p_sys->i_current_pts : p_sys->i_previous_pts ) : 0,
+ 0, p_sys->i_current_rate );
+
+ if ( !(p_sys->b_slice_i
+ && ((p_sys->p_info->current_picture->flags
+ & PIC_MASK_CODING_TYPE) == P_CODING_TYPE))
+ && !vout_SynchroChoose( p_sys->p_synchro,
+ p_sys->p_info->current_picture->flags
+ & PIC_MASK_CODING_TYPE ) )