# HG changeset patch # User bcoudurier # Date 1274302109 0 # Node ID 40911dc14bdc84ec840334d90edbd70c7ab9f507 # Parent 3a150ee29655c158bc7b69bb688e2c3893fb13f1 fix x264 encoding when delay is > number of input frames diff -r 3a150ee29655 -r 40911dc14bdc libx264.c --- a/libx264.c Wed May 19 20:18:40 2010 +0000 +++ b/libx264.c Wed May 19 20:48:29 2010 +0000 @@ -102,12 +102,14 @@ x4->pic.i_type = X264_TYPE_AUTO; } + do { if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0) return -1; bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0); if (bufsize < 0) return -1; + } while (!bufsize && !frame && x264_encoder_delayed_frames(x4->enc)); /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */ x4->out_pic.pts = pic_out.i_pts;