+ /* If a discontinuity has been encountered, then wait till
+ * the next Intra frame before continuing with packetizing */
+ if( p_sys->b_discontinuity &&
+ p_sys->b_sync_on_intra_frame )
+ {
+ if( p_pic->i_flags & BLOCK_FLAG_TYPE_I )
+ {
+ msg_Dbg( p_dec, "synced on intra frame" );
+ p_sys->b_discontinuity = VLC_FALSE;
+ p_pic->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ }
+ else
+ {
+ msg_Dbg( p_dec, "waiting on intra frame" );
+ p_sys->i_state = STATE_NOSYNC;
+ block_Release( p_pic );
+ break;
+ }
+ }
+