[x264-devel] Fix incorrect frame duration for VFR input for some frames
Anton Mitrofanov
git at videolan.org
Mon Feb 7 06:31:29 CET 2011
x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Wed Feb 2 22:51:45 2011 +0300| [ad58211837d4dfce51ac2824d0353703017d1812] | committer: Jason Garrett-Glaser
Fix incorrect frame duration for VFR input for some frames
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=ad58211837d4dfce51ac2824d0353703017d1812
---
encoder/encoder.c | 3 +--
encoder/lookahead.c | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/encoder/encoder.c b/encoder/encoder.c
index 02fcf85..53c4033 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -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;
diff --git a/encoder/lookahead.c b/encoder/lookahead.c
index 31ae04e..7e04864 100644
--- a/encoder/lookahead.c
+++ b/encoder/lookahead.c
@@ -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 );
More information about the x264-devel
mailing list