- p_sys->i_offset = 4; /* To find next startcode */
-
- case STATE_NEXT_SYNC:
- /* TODO: If p_block == NULL, flush the buffer without checking the
- * next sync word */
-
- /* Find the next startcode */
- if( block_FindStartcodeFromOffset( &p_sys->bytestream, &p_sys->i_offset, p_sys->p_startcode, 3 ) != VLC_SUCCESS )
- return NULL; /* Need more data */
-
- /* Get the new fragment and set the pts/dts */
- p_pic = block_New( p_dec, p_sys->i_offset );
- block_BytestreamFlush( &p_sys->bytestream );
- p_pic->i_pts = p_sys->bytestream.p_block->i_pts;
- p_pic->i_dts = p_sys->bytestream.p_block->i_dts;
+ if( p_sys->b_sequence_header && p_sys->sh.b_interlaced &&
+ p_block->i_buffer > i_startcode+1 &&
+ (p_block->p_buffer[i_startcode+1] & 0xc0) == 0xc0 )
+ p_block->p_buffer[i_startcode] = IDU_TYPE_FIELD;
+ else
+ p_block->p_buffer[i_startcode] = IDU_TYPE_FRAME;
+ }
+ }
+ p_sys->b_check_startcode = false;
+ }