int i_cpb_delay_lookahead;
int b_queued_intra_refresh;
- int64_t i_reference_invalidate_pts;
int64_t i_last_idr_pts;
/* We use only one SPS and one PPS */
return -1;
}
h = h->thread[h->i_thread_phase];
- h->i_reference_invalidate_pts = pts;
+ if( pts >= h->i_last_idr_pts )
+ for( int i = 0; h->frames.reference[i]; i++ )
+ if( pts <= h->frames.reference[i]->i_pts )
+ h->frames.reference[i]->b_corrupt = 1;
return 0;
}
h->fenc->param->param_free( h->fenc->param );
}
- if( h->i_reference_invalidate_pts )
- {
- if( h->i_reference_invalidate_pts >= h->i_last_idr_pts )
- for( int i = 0; h->frames.reference[i]; i++ )
- if( h->i_reference_invalidate_pts <= h->frames.reference[i]->i_pts )
- h->frames.reference[i]->b_corrupt = 1;
- h->i_reference_invalidate_pts = 0;
- }
-
if( !IS_X264_TYPE_I( h->fenc->i_type ) )
{
int valid_refs_left = 0;
* In multi-pass encoding, if x264_encoder_invalidate_reference is called differently in each pass,
* behavior is undefined.
*
- * Should not be called during an x264_encoder_encode.
+ * Should not be called during an x264_encoder_encode, but multiple calls can be made simultaneously.
*
* Returns 0 on success, negative on failure. */
int x264_encoder_invalidate_reference( x264_t *, int64_t pts );