- case STATE_BUFFER:
- if( !p_block->i_buffer )
- {
- block_Release( p_block );
- return NULL;
- }
- if( p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY
- | BLOCK_FLAG_CORRUPTED))
- cc_Flush( &p_sys->cc );
-
- if( (p_block->i_flags & (BLOCK_FLAG_DISCONTINUITY
- | BLOCK_FLAG_CORRUPTED)) &&
- p_sys->p_synchro &&
- p_sys->p_info->sequence &&
- p_sys->p_info->sequence->width != (unsigned)-1 )
- {
- decoder_SynchroReset( p_sys->p_synchro );
- if( p_sys->p_info->current_fbuf != NULL
- && p_sys->p_info->current_fbuf->id != NULL )
- {
- p_sys->b_garbage_pic = 1;
- p_pic = p_sys->p_info->current_fbuf->id;
- }
- else
- {
- uint8_t *buf[3];
- buf[0] = buf[1] = buf[2] = NULL;
- if( (p_pic = GetNewPicture( p_dec, buf )) == NULL )
- {
- p_block->i_buffer = 0;
- break;
- }
- mpeg2_set_buf( p_sys->p_mpeg2dec, buf, p_pic );
- mpeg2_stride( p_sys->p_mpeg2dec, p_pic->p[Y_PLANE].i_pitch );
- }
- p_sys->p_picture_to_destroy = p_pic;
-
- if ( p_sys->b_slice_i )
- {
- decoder_SynchroNewPicture( p_sys->p_synchro,
- I_CODING_TYPE, 2, 0, 0,
- p_sys->p_info->sequence->flags & SEQ_FLAG_LOW_DELAY );
- decoder_SynchroDecode( p_sys->p_synchro );
- decoder_SynchroEnd( p_sys->p_synchro, I_CODING_TYPE, 0 );
- }
- }
-
- if( p_block->i_flags & BLOCK_FLAG_PREROLL )
- {
- p_sys->b_preroll = true;
- }
- else if( p_sys->b_preroll )
- {
- p_sys->b_preroll = false;
- /* Reset synchro */
- decoder_SynchroReset( p_sys->p_synchro );
- }
-
-#ifdef PIC_FLAG_PTS
- if( p_block->i_pts )
- {
- mpeg2_pts( p_sys->p_mpeg2dec, (uint32_t)p_block->i_pts );
-
-#else /* New interface */
- if( p_block->i_pts || p_block->i_dts )
- {
- mpeg2_tag_picture( p_sys->p_mpeg2dec,
- (uint32_t)p_block->i_pts,
- (uint32_t)p_block->i_dts );
-#endif
- p_sys->i_previous_pts = p_sys->i_current_pts;
- p_sys->i_current_pts = p_block->i_pts;
- p_sys->i_previous_dts = p_sys->i_current_dts;
- p_sys->i_current_dts = p_block->i_dts;
- }
-
- mpeg2_buffer( p_sys->p_mpeg2dec, p_block->p_buffer,
- p_block->p_buffer + p_block->i_buffer );
-
- p_block->i_buffer = 0;
- break;
-
-#if MPEG2_RELEASE >= MPEG2_VERSION (0, 5, 0)
-
- case STATE_SEQUENCE_MODIFIED:
- GetAR( p_dec );
- break;
-#endif
-