]> git.sesse.net Git - x264/commitdiff
Fix incorrect frame duration for VFR input for some frames
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 2 Feb 2011 19:51:45 +0000 (22:51 +0300)
committerFiona Glaser <fiona@x264.com>
Sat, 5 Feb 2011 23:10:08 +0000 (15:10 -0800)
encoder/encoder.c
encoder/lookahead.c

index 0f3ee650891c8fb173cba083f4e527a9aa5f4637..6d6d2c2b21c799e3de24dc0d8bd4a2a7d003c552 100644 (file)
@@ -992,8 +992,7 @@ x264_t *x264_encoder_open( x264_param_t *param )
     i_slicetype_length = h->frames.i_delay;
     h->frames.i_delay += h->i_thread_frames - 1;
     h->frames.i_delay += h->param.i_sync_lookahead;
-    h->frames.i_delay += h->param.b_vfr_input && (h->param.rc.i_rc_method == X264_RC_ABR || h->param.rc.b_stat_write
-                                                 || h->param.rc.i_vbv_buffer_size);
+    h->frames.i_delay += h->param.b_vfr_input;
     h->frames.i_bframe_delay = h->param.i_bframe ? (h->param.i_bframe_pyramid ? 2 : 1) : 0;
 
     h->frames.i_max_ref0 = h->param.i_frame_reference;
index 31ae04e8aca997c54450a70c70ca60322b33013c..7e0486451005541e61ed85e0c39c04b2b12c3041 100644 (file)
@@ -100,7 +100,7 @@ static void x264_lookahead_thread( x264_t *h )
         shift = X264_MIN( h->lookahead->next.i_max_size - h->lookahead->next.i_size, h->lookahead->ifbuf.i_size );
         x264_lookahead_shift( &h->lookahead->next, &h->lookahead->ifbuf, shift );
         x264_pthread_mutex_unlock( &h->lookahead->next.mutex );
-        if( h->lookahead->next.i_size <= h->lookahead->i_slicetype_length )
+        if( h->lookahead->next.i_size <= h->lookahead->i_slicetype_length + h->param.b_vfr_input )
         {
             while( !h->lookahead->ifbuf.i_size && !h->lookahead->b_exit_thread )
                 x264_pthread_cond_wait( &h->lookahead->ifbuf.cv_fill, &h->lookahead->ifbuf.mutex );