diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2010-05-19 20:48:29 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2010-05-19 20:48:29 +0000 |
commit | d545fa56f12c345ae36cbca7e81632aaaccee240 (patch) | |
tree | ea27a886e17d0445514b3868f74f16f4662fb1d5 /libavcodec/libx264.c | |
parent | c2341b8596fbd3736a1b21cc0be4ac5997e14b8c (diff) | |
download | ffmpeg-d545fa56f12c345ae36cbca7e81632aaaccee240.tar.gz |
fix x264 encoding when delay is > number of input frames
Originally committed as revision 23197 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r-- | libavcodec/libx264.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index ec6d5ea433..2d84dc33af 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -102,12 +102,14 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf, 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; |